-
Notifications
You must be signed in to change notification settings - Fork 587
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
Feature: Proxy support #27
Comments
HTTP proxyAbout HTTP proxy support, I understand your request as a feature that would transparently (i.e. without the Android-side being aware of) proxy HTTP streams. My position is that this is a bad idea. The main reason is that it does not operate at the same level: gnirehtet redirects TCP connections, not HTTP streams. To force them to use a proxy, it would have to analyze and tamper TCP payloads containing HTTP streams (this would be dirty IMO), which may not work for HTTPS streams (since it would not be able to tamper HTTP headers). The right way to handle HTTP proxy IMO is to make the client forge proxified HTTP(S) requests. In that case, gnirehtet is considered as a tool that only provides internet access to the Internet to Android devices, as if they were connected via wifi or ethernet: they should explicitly define the proxy, locally (in the web browser or application settings) or globally (on Android, even if this is limited, you can define such a proxy, cf #4 (comment)). SOCKS proxyOf course, I could make the same argument for SOCKS proxy: you can just configure it in your device web browser (but there is no global SOCKS proxy settings for Android AFAIK). Still, the difference is that contrary to HTTP, SOCKS operates at the right level (at least for TCP connections), so in theory, it could be set almost transparently. The main problem is for DNS requests (if you want domain names to be resolved remotely), because the client must behave differently when there is a proxy (it must explicitly pass the domain name in the SOCKS protocol instead of resolving it locally). This implies that the proxy may not be transparent easily. My first idea to forward connections in gnirehtet was to use SOCKS instead of a custom relay server. See this article, some arguments also apply for using a SOCKS proxy over the current implementation of gnirehtet. Nevertheless, in theory, it would be possible to wrap the relay server so that all connections are SOCKSified, thanks to Neither:
Nor:
actually makes the relay server use the SOCKS proxy (while this works for other applications like pidgin). See: |
This may work with the Rust version. |
I have a SOCKS proxy (dispatch-proxy) in my PC. Can I use the relay server in PC with that proxy? |
Probably with:
or:
(on Linux at least). |
Android Q adds |
tsocks / proxychain can work ,but can't work well . Because gnirehtet use non-blocking connect() , and tsocks/proxychain will change connect() to block, so one blocked connect() will hang up the main loop of gnirehtet . proxychain must change connect() to block socket : I am writing a socks5 proxy (nonblocking ) patch for gnirehtet |
I fork gnirehtet and added socks5 proxy support : https://github.com/sankhwang/gnirehtet |
I fork gnirehtet and added socks5 proxy support :
https://github.com/sankhwang/gnirehtet
dhffb ***@***.***> 于2022年1月3日周一 22:41写道:
… 请问socks5代理补丁进度如何了,我尝试用proxychains4-ng 效果不是很好
—
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH5NRTTYQEU7OF2KJMPIKODUUGYQTANCNFSM4DIU2TVQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
This is not working for me on macOS - traffic does not go through the proxy. Did something change to break this? |
Can this be implemented? It looks fairly easy to add - just pass the VPN service the specified host and port, and then call this method. |
proxychains / tsocks can work with gnirehtet, but can NOT work well. so I fork and patch a non-blocking socks5 proxy fork of gnirehtet . |
useless This proxy is only a recommendation and it is possible that some apps will ignore it.
|
How to compile in ubuntu ? I'm a new in rust |
cargo build can make the target. but when I run './gnirehtet run', it had an error 2023-06-07 17:35:38.893 INFO Main: Checking gnirehtet client... can u give us a tutorial ? @sankred9527 |
I think the best next feature should be socks proxy support or http proxy support. What do you think? How complex it would to add this?
Do you have any idea where the proxy should be placed? I could try to do it myself if you don't have the time...
The text was updated successfully, but these errors were encountered: