Open pyamsoft opened 1 year ago
I ran in to an issue with some UDP applications not working and would love to see it implemented.
UDP is much trickier to proxy than TCP sadly, but this actively affects me too so its top of mind (though sadly very difficult)
This will need to be an HTTP based solution since consoles and phones dont support socks natively.
Generally speaking you can't http proxy UDP, but we will see if we can implement a proxy over http via quic or something
This will need to be an HTTP based solution since consoles and phones dont support socks natively.
Generally speaking you can't http proxy UDP, but we will see if we can implement a proxy over http via quic or something
I look forward to this as I've been struggling getting some things to work. Telegram wouldn't start a call without UDP suport. I've tried some methods to get it to work. Making it work natively would make it much easier to work with.
Perhaps a library like this could help development. https://github.com/VKCOM/KNet
Hi,
I'm not sure about directly using this knet library, as it pulls in a ton of stuff and hasn't been touched code wise for a few years.
I appreciate the enthusiasm around the topic. I have 2 bare minimum requirements for a valid UDP solution in Tetherfi, it needs to run on a non rooted Android phone, and it needs to be possible without becoming the System VPN service or needing the system Mobile Hotspot.
UDP is a lot trickier since there is no method on Android to capture any UDP traffic like there is for setting a proxy up via the wifi settings for TCP currently.
Basically, the calling app needs to speak QUIC already, and assuming it does, possibly the existing TCP proxy might already work as its a simple forwarder from a client to a server.
If the app like Telegram only talks in UDP, I am not able to capture its socket connections without being a VPN app.
Tetherfi is not a VPN app, and it never will be. The google play store would never accept it.
UDP proxying will take time, this is assuming it is even technically possible in the first place in a way that doesnt require other apps to specifically change.
Hi,
I'm not sure about directly using this knet library, as it pulls in a ton of stuff and hasn't been touched code wise for a few years.
I appreciate the enthusiasm around the topic. I have 2 bare minimum requirements for a valid UDP solution in Tetherfi, it needs to run on a non rooted Android phone, and it needs to be possible without becoming the System VPN service or needing the system Mobile Hotspot.
UDP is a lot trickier since there is no method on Android to capture any UDP traffic like there is for setting a proxy up via the wifi settings for TCP currently.
Basically, the calling app needs to speak QUIC already, and assuming it does, possibly the existing TCP proxy might already work as its a simple forwarder from a client to a server.
If the app like Telegram only talks in UDP, I am not able to capture its socket connections without being a VPN app.
Tetherfi is not a VPN app, and it never will be. The google play store would never accept it.
UDP proxying will take time, this is assuming it is even technically possible in the first place in a way that doesnt require other apps to specifically change.
I've used an app called "Android Proxy Server" and created a shadowsocks proxy with it. I've used it with Tether Fi to connect a laptop to it. That fixed the problem but I would have many instances where the app would stop working until I opened it again. The app doesn't pose as a VPN, it just creates a server. I've used others that created a socks proxy but they failed and wasn't sure why. But that was my current solution.
I will look at seeing if I can implement a shadowsocks proxy in tetherfi, to avoid the current issues with running 2 apps. It could be a workable solution.
(I believe the disconnect issues are caused by both attempting to use Wifi direct to setup local hotspots. Tetherfi expects to be the exclusive Wifi direct owner, and I imagine so does the Android Proxy Server app, which is why you are probably seeing the issue.)
I will look at seeing if I can implement a shadowsocks proxy in tetherfi, to avoid the current issues with running 2 apps. It could be a workable solution.
(I believe the disconnect issues are caused by both attempting to use Wifi direct to setup local hotspots. Tetherfi expects to be the exclusive Wifi direct owner, and I imagine so does the Android Proxy Server app, which is why you are probably seeing the issue.)
The other app does not create a wifi direct nor connection. It only hosts a server. It appears to stop working when my phone shuts off so that's most likely the app's problem.
Do we have an ETA for a shadowsocks proxy within the app?
No ETA at the moment - I still need to see if a shadowsocks proxy would be the right path forward.
It looks like a shadowsocks server is a huge undertaking - and it would require connecting clients to run a shadowsocks client. If that is the case, it won't be a solution for the long-term as would not be supported by simpler devices - though it may be an interesting stop-gap solution.
Long term would probably look at something like CONNECT-UDP, which would supposedly be supported on anything that speaks HTTP, which is exactly what we would be looking for
+1 for Socks5 proxy server.
Note that, as a workaround, it is possible to run an SSH service on the phone(e.g. SimpleSSHD), and use OpenSSH's application-level port forwarding feature to run a SOCKS server on the localhost that forwards the requests to the phone.
I have implemented a script to start such a service on GNU+Linux operating system: enable-ssh-socks-service.sh.gz
This may not work with all UDP use cases, though.
Note that, as a workaround, it is possible to run an SSH service on the phone(e.g. SimpleSSHD), and use OpenSSH's application-level port forwarding feature to run a SOCKS server on the localhost that forwards the requests to the phone.
I have implemented a script to start such a service on GNU+Linux operating system: enable-ssh-socks-service.sh.gz
This may not work with all UDP use cases, though.
Now I manually start a socks5 proxy server(3proxy) in termux when using tetherfi, it works fine and just a bit complex.
Good to hear that this works as a workaround for client devices that have access to a UNIXlike shell.
I assume, were I to incorporate something like this in-app, that TetherFi would launch a SOCKS SSH server on a port (2222) at the Wi-Fi direct IP (192.168.49.1), and the user would have to manually configure their client device (laptop, desktop) to point at it as a SOCKS proxy or use proxychains or something of the sort?
At that point, I would have to build TetherFi as a full SOCKS proxy, or a SOCKS and HTTP proxy - this may increase battery usage.
This doesn't sound like it would be a solution for things like gaming consoles, which do not support SOCKS, but it certainly is a step in the right direction!
@pyamsoft yes implementing this would be really cool im trying to get steam to work with all these setups mentioned here in the comments but so far not working for me :/ definitely needs udp
+1 for Socks5 proxy.
@chromer030 could this be used as a workaround too? https://github.com/jpillora/chisel
@moraroy, internal server on same port is best solution. (Apps i know using this: nekobox, husi)
Any updates? I'm going on a field trip for school in like a few months and I'm in charge of being the hotspot person and some people use apps that use udp, My unlimited data plan throttles hotspot horribly (20 mbps) while I get 200+ mbps
A small progress update.
A development version of TetherFi has support for a SOCKS4 and SOCKS5 proxy on port 8229. It is not ready yet for general usage.
We generally require 4A and 5H because a device connected to TetherFi is assumed to not have another functioning Internet connection, so it must resolve DNS on the phone, though there is also support for normal 4 and 5. Future work will validate socks5 connecting binding and support for UDP association.
The code is not stable enough yet for release, so it will not come in the immediate next release (forecasted 48), but once it stabilizes, TetherFi will be a dual http and socks proxy application.
I will add the option to run either or both proxies in the future.
Even with socks support, your client device will need to support socks, via something like native support (eg firefox) or forced (eg proxychains), so game consoles like the Switch and PS4 which lack SOCKS natively won't be supported without a Router level proxy of some sort, which is out of scope.
Not a perfect solution, but definitely progress in the right direction :)
We may need to build a SOCKS5 proxy for UDP traffic since we can't transparent proxy UDP from an HTTP proxy