-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
macOS client doesn't work through SOCKS5 Proxy #453
Comments
I found that I forgot to mosaic email address. And it seems impossible to delete the issue. So I guess I'll leave it open then. |
You can edit your post to delete the screenshot! |
Alternatively, I can delete the issue completely, if you prefer. |
Thanks for the advice. Screenshots have been replaced. |
Regarding the actual issue, I'm not sure how SOCKS5 proxies work exactly. Since #434, proxy settings are retrieved from environment variables and handled by the
Could you check if the environment variable |
It sounds kinda dumb but I really don't know how to check it(noob in coding). But I do find out that me using privoxy to forward HTTP to SOCKS5 proxy is only useful for other devices that connect to the same network as my Mac, but not for Mac apps in this every same device. Tried localhost:8118(8118 is default port selection in privoxy), 0.0.0.0:8118, 127.0.0.1:8118, and local IP of my Mac:8118. None of them worked. I guess I'll have to dig deeper into Privoxy manuals, or resort to other apps for HTTP proxy in this local machine. Maestral sync should work afterwards. |
Not dumb at all! On macOS, you can check this by opening the Terminal app and typing the command (and hitting enter):
I suspect that this will just return an empty line, which means that the proxy configuration is not stored in the environment variable but somewhere else. If it's not too much trouble, you can also try the following: Again in the Terminal app, type
This time, I hope that the correct proxy configuration should be shown, namely:
If yes, I'll know how to fix it... |
Thanks for detailed instructions. I do get an empty line after the first command. And in Python3, what I have after those 2 commands is 127.0.0.1:1083, which is the original SOCKS5 proxy that I deploy. Unfortunately I didn't take screenshot, cuz I thought what you meant by "correct proxy configuration"was to type echo $https_proxy again, so I just close the terminal and open a new one. It should be: {'socks5': '127.0.0.1:1083'} if I remember it correctly. Edit: But I can do a workaround to get similar result that's expected from you. alias http='export all_proxy=http://0.0.0.0:8118' And it seems to be working based on the following screenshot: |
Ok, thanks for the detailed infos. It appears that the situation is more complicated than I thought. Python's request library will retrieve the proxy settings from the How and where did you configure the SOCKS5 proxy? Could you also check the return value from the following Python command:
This will bypass all environment settings and directly get the proxy configuration from System Preferences. What does this return in your case? |
The reliability of This is what I did using I also found some similar issues on Windows: https://stackoverflow.com/questions/65931275/python-requests-module-does-it-use-system-level-on-windows-proxy-settings A workaround on macOS is to use |
Indeed, it looks like In particular, I'm a bit reluctant to introduce custom support for SOCKS proxies in Maestral, IMO this should be handled by using an external library, or ideally by allowing Python's urllib to detect them. |
I've filed python/cpython#104180 upstream and will create a PR to fix this in urllib. |
The fix from python/cpython#104181 included in Python 3.12 and the latest macOS app bundle v1.9.1 is based on Python 3.12. |
Describe the bug
I'm using dropbox in China, where the service is blocked by national firewall. Dropbox client can work with self created SOCKS5 proxy on rented server. However Maestral client can't make connection the same way, even if I enable SOCKS5-Proxy in WLAN settings or route the client through Proxifier.
With VPN enabled
VPN disabled, only SOCKS5 proxy.
With conventional VPN Maestral can work fine though, which is a bit strange.
To Reproduce
Expected behaviour
Is there any workaround? I tried to convert socks5 to https and route Maestral through https proxy in Proxifier. Sadly it still won't work.
System:
Additional context
The text was updated successfully, but these errors were encountered: