nneonneo / iOS-SOCKS-Server

iOS HTTP/SOCKS proxy server for fake-tethering
275 stars 33 forks source link

Question regarding Wi-Fi #21

Closed zachswe closed 1 year ago

zachswe commented 1 year ago

I noticed the iPhone running Pythonista needs to join a Wi-Fi network in order to share the tethered newtork to say a Macbook Pro connected to the same Wi-Fi. But if the iPhone is connected to a Wi-Fi network, why would any traffic being able to use cellular data instead of being forced to use Wi-Fi?

philrosenthal commented 1 year ago

This app forces the traffic over a particular interface using a method that is available for any iOS app, even though it is not commonly used. The method is to force any outbound sockets to use a specific source ip address. The code attempts to figure out which ip address is for each interface (ie: WiFi, cellular data, cellular hotspot data, Bluetooth, etc), and then use the ip address for the cellular data (not hotspot) as the source ip address. The code is not 100% reliable on detecting the difference between cellular hotspot data and regular cellular data, but it would be 100% certain to never use your WiFi data. Hope this helps!On Oct 2, 2023, at 1:22 PM, zachswe @.***> wrote: I noticed the iPhone running Pythonista needs to join a Wi-Fi network in order to share the tethered newtork to say a Macbook Pro connected to the same Wi-Fi. But if the iPhone is connected to a Wi-Fi network, why would any traffic being able to use cellular data instead of being forced to use Wi-Fi?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

nneonneo commented 1 year ago

@philrosenthal is exactly right. In fact, we even use a custom DNS client (dnspython) so that we can make DNS requests over the cellular network instead of over WiFi. Hope that answers your question!