The technology itself is also pieced together by one detail
The cause of the incident is that the server network is blocked by a website and needs to be accessed using the http proxy. Because there is no stable and easy to use http proxy address (online free, but also unstable), but there is still a server on the cloud (on the cloud), so I want to build a shadowsocks server on the cloud server, build on the local server The client is used to connect. If you have the idea, let’s do it. It is not difficult to build a shadowsocks service. However, it should take only half an hour to get the job, but it took more than 2 hours (socks to http proxy problem), so here A subtotal, to the effect.
Set up the shadowsocks server, and introduce the windows and linux building methods.
Install python first, then use pip to install shadowsocks.
Then create a file like: config.json
After filling out, run in cmd:
If there is no error, the shadowsocks server has already been set up.
Similar to windows, install python and pip first, then install shadowsocks via pip.
Single user configuration:
Add the started command to the end of the /etc/rc.local file.
Change the previous ssserver -c /etc/shadowsocks.json -d start to ssserver -c /etc/shadowsocks.json -d start –user ssuser
I installed the shadowsock client. I also divided it into windows and Linux.
Windows installation shadowsocks client is relatively simple, directly download the installer.
After startup, fill in the corresponding configuration of the server (ip, port, password, encryption)
The PAC mode is recommended.
- The main time spent this time is to build a shadowsocks client on Linux. There are a lot of pits (~ mainly my own brain is a little dizzy~)*1pip install shadowsocks
The configuration is also very simple, create a shadowsocks.json file:
The content is similar to the above, and then run on the command line: sslocal -c shadowsocks.json The system will now listen on the local 1080 port.
At this time is not a GUI window, just a command line, how to use the curl and other commands to go to the http proxy (most of the online information is to set up the browser, but not suitable for this article), originally can be solved with other solutions, but at this time, the choice of shadowsocks, I can only go all the way. After everything is installed, after the startup, I found that the http proxy still can’t be used, and then I started the debugging of my heart and mind, and I still can’t use it for a long time. Finally, my colleagues found the problem (the socks proxy needs to be converted to http proxy, windows You can set the browser, linux needs to download the tool to convert).
Found the reason, then the question is how to say that the socks agent is converted to http proxy?
- proxychains can automatically convert the socks proxy to http proxy.
- polipo uses this tool to convert the socks proxy to http proxy.
Modify the configuration file proxychains.conf
Stop polipo service sudo service polipo stop
Edit the polipo configuration file /etc/polipo/config and add the following:
Start polipo service sudo service polipo start
- App configuration http_proxy=http://127.0.0.1:1081
- bash can edit $HOME/.bashrc, add export http_proxy=http://127.0.0.1:1081 to export environment variables. The current bash is to execute source $HOME/.bashrc to make the configuration file take effect.
Take zsh under mac as an explanation:
Add the following proxy configuration:
Make the configuration take effect:
For details, please refer to: [http://blog.csdn.net/zcq8989/article/details/50545078] (http://blog.csdn.net/zcq8989/article/details/50545078)