Skip to content

Commit

Permalink
fix adding host when copying device
Browse files Browse the repository at this point in the history
  • Loading branch information
aluedeke committed Nov 11, 2024
1 parent 636a36f commit 621d509
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ios/tunnel/tunnel_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ func TunnelInfoForDevice(udid string, tunnelInfoHost string, tunnelInfoPort int)
return info, nil
}

func ListRunningTunnels(tunnelInfoPort int) ([]Tunnel, error) {
func ListRunningTunnels(tunnelInfoHost string, tunnelInfoPort int) ([]Tunnel, error) {
c := http.Client{
Timeout: 5 * time.Second,
}
res, err := c.Get(fmt.Sprintf("http://127.0.0.1:%d/tunnels", tunnelInfoPort))
res, err := c.Get(fmt.Sprintf("http://%s:%d/tunnels", tunnelInfoHost, tunnelInfoPort))
if err != nil {
return nil, fmt.Errorf("TunnelInfoForDevice: failed to get tunnel info: %w", err)
}
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ The commands work as following:
}
startTunnel(context.TODO(), pairRecordsPath, tunnelInfoPort, useUserspaceNetworking)
} else if listCommand {
tunnels, err := tunnel.ListRunningTunnels(tunnelInfoPort)
tunnels, err := tunnel.ListRunningTunnels(tunnelInfoHost, tunnelInfoPort)
if err != nil {
exitIfError("failed to get tunnel infos", err)
}
Expand Down Expand Up @@ -2276,6 +2276,7 @@ func deviceWithRsdProvider(device ios.DeviceEntry, udid string, address string,
rsdProvider, err := rsdService.Handshake()
device1, err := ios.GetDeviceWithAddress(udid, address, rsdProvider)
device1.UserspaceTUN = device.UserspaceTUN
device1.UserspaceTUNHost = device.UserspaceTUNHost
device1.UserspaceTUNPort = device.UserspaceTUNPort
exitIfError("error getting devicelist", err)

Expand Down

0 comments on commit 621d509

Please sign in to comment.