-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve WebSockets support #300
Comments
So there's two pieces here, the WS and wss protocol. For WS, we would have to implement the HTTP 1.1 upgrade flow, which I believe is straightforward but not the easiest. For wss, I think all we are able to do is respond to the initial CONNECT tunnel, past that we are just a delegate for proxies network data. In theory, wss protocol should already work, as evidenced by web chat usually working when accessed through a mobile browser. For fun, here are some notes about apps which I wrote up while using the proxy on a plane.
|
Testing using the node.js powered Using Sadly, since third-party apps on the device are allowed by the OS to "go around" the proxy, things like WSS requests from a client library would not be intercepted by the hotspot proxy in all cases, which leads to the inconsistent behavior in chat apps like Discord. Not sure what else I can do here unfortunately. |
debug log: tetherfi-debug-0202405241408.log.gz |
I am so far unable to reproduce either of these issues using the production or latest Dev version. That being said, I think this behavior is a memory leak on the server side of TetherFi. If you turn off the hotspot, kill the app, and then try again, does it work? Seems to only leak after a "long time" |
Confirmed a memory leak from never closing sockets does at least effect this issue. The next version will have a tweak to close inactive socket connections after 1 minute (if a network connection is started, but no data is transferred for a full minute, it will close the connection). This should help us clean up and reduce memory usage, which should avoid the IOException that causes these rejected connections. |
Version 43 was just approved on the store and includes a new option: While this is OFF by default, I recommend you turn on the I will continue to investigate memory usage, but as far the original issue about websockets in third-party apps there is very little we can do. Mobile websites will usually work, but the actual apps themselves do NOT use the system proxy on Android (only the default browser app does). Sadly, this may be all that we can do for now, until we find a more encompassing solution. Sorry :( Thank you for your contribution to the project! |
Thanks for your work! I no longer have problems using the web versions of the WebSockets applications at the moment so it's all fine. |
Currently, TetherFi doesn't support WebSockets which is used in several web applications(e.g. Discord and IRCcloud) that implement this relatively modern technology. As more and more applications adopt this feature(and drop support to legacy counterparts like long polling) we need to investigate whether we can support such usecase.
Reverse proxy implementations like NGINX seems to have already implemented such support, maybe it is also applicable to forward proxies as well?
Implement SOCKS proxy(#101) may make this feature request obsolete, though...
The text was updated successfully, but these errors were encountered: