This commit 303ece5 uses socket_create to bind and listen address, however by default it seems to bind to IPv6 address only on my mac device.
IPv4 loopback
$ iproxy -s '127.0.0.1' 2222:22
$ sudo lsof -P -i tcp:2222
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
iproxy 4759 user 3u IPv4 0x920c56b46d641c07 0t0 TCP localhost:2222 (LISTEN)
# ssh ok
IPv6 loopback
$ iproxy -s '::1' 2222:22
$ sudo lsof -P -i tcp:2222
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
iproxy 4898 user 3u IPv6 0x920c56b935c599b7 0t0 TCP localhost:2222 (LISTEN)
# ssh ok
Default: IPv6 any
$ iproxy 2222:22
$ sudo lsof -P -i tcp:2222
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
iproxy 4923 user 4u IPv6 0x920c56b935c599b7 0t0 TCP *:2222 (LISTEN
$ ssh root@127.0.0.1 -p 2222
ssh: connect to host 127.0.0.1 port 2222: Connection refused
$ ssh root@localhost -p 2222
# success
Env
$ sw_vers
ProductName: macOS
ProductVersion: 14.4.1
BuildVersion: 23E224
According to the code at https://github.com/libimobiledevice/libimobiledevice-glue/blob/fde8946a3988790fd5d3f01fc0a1fd43609ab1d1/src/socket.c#L534
On my device, I will get 2 address which are [::]:2222 and 0.0.0.0:2222 by calling getaddrinfo, however due to the break, the second address will not be bind, which does not match the help (127.0.0.1) / commit (ipv4+ipv6) description.
This commit 303ece5 uses
socket_createto bind and listen address, however by default it seems to bind to IPv6 address only on my mac device.IPv4 loopback
IPv6 loopback
Default: IPv6 any
Env
According to the code at https://github.com/libimobiledevice/libimobiledevice-glue/blob/fde8946a3988790fd5d3f01fc0a1fd43609ab1d1/src/socket.c#L534
On my device, I will get 2 address which are
[::]:2222and0.0.0.0:2222by callinggetaddrinfo, however due to thebreak, the second address will not bebind, which does not match the help (127.0.0.1) / commit (ipv4+ipv6) description.