insanum / sncli

Simplenote CLI
MIT License
396 stars 34 forks source link

support shadow socks proxy configuration #39

Closed hatelove85911 closed 5 years ago

hatelove85911 commented 7 years ago

my sncli client can't login due to the GFW of China, please help add support for socks proxy.

samuelallan72 commented 7 years ago

It seems the Requests HTTP library we're using supports socks proxies directly (see http://docs.python-requests.org/en/master/user/advanced/#socks for more info). It should be doable - I'll investigate when I get some free time next.

N0ury commented 6 years ago

I use proxychains (socks5), and it works fine.

samuelallan72 commented 5 years ago

@hatelove85911 We can't implement this as a configuration variable in sncli now, since we're using the simperium library for syncing. However this uses requests, and according to the requests docs:

You can also configure proxies by setting the environment variables HTTP_PROXY and HTTPS_PROXY.

You should be able to test and use this like:

export HTTPS_PROXY="http://my.proxy"
sncli

Put it in a shell script, or alias, or set the env var system-wide to use it automatically.