Last active
March 15, 2025 13:08
-
-
Save scalaview/4417d7be2d248078522b21ff6f6890d2 to your computer and use it in GitHub Desktop.
Convert Shadowsocks into an HTTP proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First run polipo with parent proxy set to Shadowsocks: | |
apt-get install polipo | |
service polipo stop | |
polipo socksParentProxy=localhost:1080 | |
Then you can play with the HTTP proxy: | |
http_proxy=http://localhost:8123 apt-get update | |
http_proxy=http://localhost:8123 curl www.google.com | |
http_proxy=http://localhost:8123 wget www.google.com | |
git config --global http.proxy 127.0.0.1:8123 | |
git clone https://github.com/xxx/xxx.git | |
git xxx | |
git xxx | |
git config --global --unset-all http.proxy | |
```python | |
import socks | |
import socket | |
socks.set_default_proxy(socks.SOCKS5, "localhost", 1086) | |
socket.socket = socks.socksocket | |
``` | |
Write proxy settings | |
$ npm config set proxy http://localhost:3128 | |
$ npm config set https-proxy http://localhost:3128 | |
This config is great for SquidMan app. | |
Delete proxy settings | |
$ npm config delete http-proxy | |
$ npm config delete https-proxy | |
alias lpiv="ssh -i $HOME/.ssh/developer.pem [email protected] -o 'ProxyCommand=nc -X connect -x 127.0.0.1:8123 %h %p' -t 'cd /var/www/livingsmartapi/current; bash -l'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Shadowsocks iClient | |
After=network.target | |
[Service] | |
ExecStart=/usr/bin/ss-local -c /etc/shadowsocks-libev/config.json | |
ExecStartPost=/usr/bin/polipo socksParentProxy=localhost:1081 | |
Restart=on-abort | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment