Skip to content

Commit 4ba4207

Browse files
authored
add userspace port option (#451)
* When trying to run a command while manually supplying `rsd-port` and `address` and using userspace tunnels, also the userspace tunnel port has to be supplied or it doesn't work Thanks Nikola!
1 parent 89cbe52 commit 4ba4207

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Options:
148148
> This parameter is similar to '--address' and can be obtained by the same log filter
149149
--proxyurl=<url> Set this if you want go-ios to use a http proxy for outgoing requests, like for downloading images or contacting Apple during device activation.
150150
> A simple format like: "http://PROXY_LOGIN:PROXY_PASS@proxyIp:proxyPort" works. Otherwise use the HTTP_PROXY system env var.
151+
--userspace-port=<port> Optional. Set this if you run a command supplying rsd-port and address and your device is using userspace tunnel
151152
152153
The commands work as following:
153154
The default output of all commands is JSON. Should you prefer human readable outout, specify the --nojson option with your command.
@@ -327,12 +328,17 @@ The commands work as following:
327328
udid, _ := arguments.String("--udid")
328329
address, addressErr := arguments.String("--address")
329330
rsdPort, rsdErr := arguments.Int("--rsd-port")
331+
userspaceTunnelPort, userspaceTunnelErr := arguments.Int("--userspace-port")
330332

331333
device, err := ios.GetDevice(udid)
332334
// device address and rsd port are only available after the tunnel started
333335
if !tunnelCommand {
334336
exitIfError("Device not found: "+udid, err)
335337
if addressErr == nil && rsdErr == nil {
338+
if userspaceTunnelErr == nil {
339+
device.UserspaceTUN = true
340+
device.UserspaceTUNPort = userspaceTunnelPort
341+
}
336342
device = deviceWithRsdProvider(device, udid, address, rsdPort)
337343
} else {
338344
info, err := tunnel.TunnelInfoForDevice(device.Properties.SerialNumber, tunnelInfoPort)

0 commit comments

Comments
 (0)