Skip to content

Commit cd9dfc7

Browse files
authored
fix(driver): expose native-host option and set default to 127.0.0.1 (#3816)
1 parent c7696f3 commit cd9dfc7

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

.changes/webdriver-native-host.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-driver": patch
3+
---
4+
5+
Expose `native-host` option in tauri-driver and set default to `127.0.0.1`.

tooling/webdriver/src/cli.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ FLAGS:
1313
OPTIONS:
1414
--port NUMBER Sets the tauri-driver intermediary port
1515
--native-port NUMBER Sets the port of the underlying WebDriver
16+
--native-host HOST Sets the host of the underlying WebDriver (Linux only)
1617
--native-driver PATH Sets the path to the native WebDriver binary
1718
";
1819

1920
#[derive(Debug, Clone)]
2021
pub struct Args {
2122
pub port: u16,
2223
pub native_port: u16,
24+
pub native_host: String,
2325
pub native_driver: Option<PathBuf>,
2426
}
2527

@@ -42,6 +44,7 @@ impl From<pico_args::Arguments> for Args {
4244
let parsed = Args {
4345
port: args.value_from_str("--port").unwrap_or(4444),
4446
native_port: args.value_from_str("--native-port").unwrap_or(4445),
47+
native_host: args.value_from_str("--native-host").unwrap_or(String::from("127.0.0.1")),
4548
native_driver,
4649
};
4750

tooling/webdriver/src/webdriver.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,6 @@ pub fn native(args: &Args) -> Command {
4747
let mut cmd = Command::new(native_binary);
4848
cmd.env("TAURI_AUTOMATION", "true");
4949
cmd.arg(format!("--port={}", args.native_port));
50+
cmd.arg(format!("--host={}", args.native_host));
5051
cmd
5152
}

0 commit comments

Comments
 (0)