-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Basic SOCKS proxy support #195
Conversation
if host != "" and port != 0: | ||
# Reset proxy env vars | ||
environ["all_proxy"] = "" | ||
environ["ALL_PROXY"] = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do this because something kept reading it from the environment variable and did not allow the app to work. But from my experimentation using NetHogs, the proxy seems to work just fine, so it should be okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not work here (timeout on search). Looks like settings variable is mandatory.
Tried but your right, something manually tries to understand proxy env :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see :(
Too bad. Well... proper proxy support and a bunch of other large changes will be coming eventually, so maybe we will have to put this off until then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, converting to draft and will experiment again soon if possible. But unfortunately... it works for me now. So I don't know how to proceed 😅 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will try to debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be awesome! Thanks!
@bellegarde-c if you find time to, could you test to see if this works as expected in a real-world test? (I could only test with the experimental setup you suggested 😅) |
Ok, tried this code:
But fails with httpx.ConnectError: [Errno 97] Address family not supported by protocol So until httpx socks support is out encode/httpx#203 and gtrans add support for it, we can't do more IMO. |
Hmm, or it's because IPV6 is disabled on my laptop. |
Interesting... This works for me until I enable the proxy in GNOME settings. When I do that, httpx tries to use the environment variable and fails irrespective of it is |
There is a fairly stable 3rd party SOCKS implementation: httpx-socks |
We use httpx through py-googletrans for Google Translate. So we can't implement this. |
Closing this because transition to libsoup should solve this and is being done in #235 . |
Fixes #192
Based on Lollypop's handling of the same. Unfortunately, this isn't exactly ideal. As discussed in #115 (comment) previously,
py-googletrans
andhttpx
do not properly support proxies. But for now, this should hopefully work.