mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix(driver): expose native-host option and set default to 127.0.0.1 (#3816)
This commit is contained in:
5
.changes/webdriver-native-host.md
Normal file
5
.changes/webdriver-native-host.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-driver": patch
|
||||
---
|
||||
|
||||
Expose `native-host` option in tauri-driver and set default to `127.0.0.1`.
|
||||
@@ -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<PathBuf>,
|
||||
}
|
||||
|
||||
@@ -42,6 +44,7 @@ impl From<pico_args::Arguments> 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,
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user