diff --git a/.changes/webdriver-native-host.md b/.changes/webdriver-native-host.md new file mode 100644 index 000000000..007f2e2f7 --- /dev/null +++ b/.changes/webdriver-native-host.md @@ -0,0 +1,5 @@ +--- +"tauri-driver": patch +--- + +Expose `native-host` option in tauri-driver and set default to `127.0.0.1`. diff --git a/tooling/webdriver/src/cli.rs b/tooling/webdriver/src/cli.rs index 5f2e77abb..d2c7494c9 100644 --- a/tooling/webdriver/src/cli.rs +++ b/tooling/webdriver/src/cli.rs @@ -13,6 +13,7 @@ FLAGS: OPTIONS: --port NUMBER Sets the tauri-driver intermediary port --native-port NUMBER Sets the port of the underlying WebDriver + --native-host HOST Sets the host of the underlying WebDriver (Linux only) --native-driver PATH Sets the path to the native WebDriver binary "; @@ -20,6 +21,7 @@ OPTIONS: pub struct Args { pub port: u16, pub native_port: u16, + pub native_host: String, pub native_driver: Option, } @@ -42,6 +44,7 @@ impl From for Args { let parsed = Args { port: args.value_from_str("--port").unwrap_or(4444), native_port: args.value_from_str("--native-port").unwrap_or(4445), + native_host: args.value_from_str("--native-host").unwrap_or(String::from("127.0.0.1")), native_driver, }; diff --git a/tooling/webdriver/src/webdriver.rs b/tooling/webdriver/src/webdriver.rs index 177b17d18..ac610d2e1 100644 --- a/tooling/webdriver/src/webdriver.rs +++ b/tooling/webdriver/src/webdriver.rs @@ -47,5 +47,6 @@ pub fn native(args: &Args) -> Command { let mut cmd = Command::new(native_binary); cmd.env("TAURI_AUTOMATION", "true"); cmd.arg(format!("--port={}", args.native_port)); + cmd.arg(format!("--host={}", args.native_host)); cmd }