mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-11 23:30:55 +03:00
Configurable capture backend (#150)
capture backend can now be configured via the `capture_backend` cli argument / config entry
This commit is contained in:
committed by
GitHub
parent
232c048c19
commit
3528ef4fae
@@ -8,7 +8,7 @@ use tokio::signal;
|
||||
|
||||
use crate::{
|
||||
client::{ClientConfig, ClientHandle, ClientManager, ClientState},
|
||||
config::Config,
|
||||
config::{CaptureBackend, Config},
|
||||
dns,
|
||||
frontend::{FrontendListener, FrontendRequest},
|
||||
server::capture_task::CaptureEvent,
|
||||
@@ -77,7 +77,7 @@ impl Server {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn run(&self) -> anyhow::Result<()> {
|
||||
pub async fn run(&self, backend: Option<CaptureBackend>) -> anyhow::Result<()> {
|
||||
// create frontend communication adapter
|
||||
let frontend = match FrontendListener::new().await {
|
||||
Some(f) => f?,
|
||||
@@ -97,11 +97,12 @@ impl Server {
|
||||
|
||||
// input capture
|
||||
let (mut capture_task, capture_channel) = capture_task::new(
|
||||
backend,
|
||||
self.clone(),
|
||||
sender_tx.clone(),
|
||||
timer_tx.clone(),
|
||||
self.release_bind.clone(),
|
||||
);
|
||||
)?;
|
||||
|
||||
// input emulation
|
||||
let (mut emulation_task, emulate_channel) = emulation_task::new(
|
||||
|
||||
Reference in New Issue
Block a user