pyamsoft / tetherfi

TetherFi - Internet sharing without Root
Apache License 2.0
276 stars 24 forks source link

Transparent proxy #278

Closed wspvlv closed 3 months ago

wspvlv commented 3 months ago

Is it possible to set up a transparent proxy, so that one doesn't have to configure each app to use the proxy and to make programs that are oblivious to their existence to work through proxy?

pyamsoft commented 3 months ago

I am preserving this comment but it missed the point of the original question, it should be ignored.

Hi, good question but sadly tl;dr no.

Nothing prevents you from setting up your own Proxy as the transparent between TetherFi and a client, but given that TetherFi is not a root app we cannot take over the networking stack like you would on a PC

As a result, all connections have to be explicit because its a fully userspace, unprivileged setup.

wspvlv commented 3 months ago

I don't see how that's an issue. The client need to be configured to send all its packets through the proxy server, not the server itself. So if the client OS is versetile enough it should work.

pyamsoft commented 3 months ago

Yes, thus nothing is preventing your client configuration from doing so, but its not the job of TetherFi, as it is the server in this case.

Whatever you are using to connect should be configured to send through the Proxy instead.

brlin-tw commented 3 months ago

@wspvlv

The client need to be configured to send all its packets through the proxy server, not the server itself.

The server still needs to configure firewall rules (as root) to masquerade the source IP address fields of these "packets" so that the response packets can reach back to the server and in turn to the client itself.

Refer: Network address translation - Wikipedia

If you are certain this can be done without root privileges please elaborate on the exact technical way to do it, otherwise, we can't implement it.