Hi,
I have an extension using NEPacketTunnelProvider, I need bind
both lan address and localhost so that other apps can connect it and transfer data.
I found that if I bind
INADDR_LOOPBACK
, other apps on the phone can connect it using the localhost(127.0.0.1)
If I bind
INADDR_ANY
, other apps on the phone can connect it using the lan address
but not the localhost(127.0.0.1)
My question is why other app on the phone can not connect using localhost(127.0.0.1)
when binding INADDR_ANY
?
Thank you.
NEPacketTunnelNetworkSettings:
- Exclude route: 192.168.0.0/16, 127.0.0.0/8, 169.254.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 255.255.255.255/32, 239.255.255.250/32, fc00::/7, fe80::/10, ff02::c/128, ff05::c/128, ff08::c/128, ff0e::c/128
- Include route: [NEIPv4Route defaultRoute]
- NEProxySettings with HTTPEnabled and HTTPSEnabled to localhost (a http server)
- NEProxySetting exception: 192.168.0.0/16, 127.0.0.0/8, 169.254.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 255.255.255.255/32, localhost, *.local, captive.apple.com
- NEProxySetting excludeSimpleHostnames: YES