Convert Shadowsocks to Sock5/HTT

2017-10-17  本文已影响594人  寺院的研究僧

1. Shadow socks converted to sock5 proxy

git clone https://github.com/hugozhu/ss2http
or

go get github.com/hugozhu/ss2http
cd $GOPATH/src/github.com/hugozhu/ss2http

cat <<EOF >config.json
{ "server":"123.123.123.123", "server_port":1234, "local_address":"127.0.0.1", "local_port":30080, "password":"****", "method":"rc4-md5", "timeout":600 }
EOF
go run ss2http.go --proxy_type socks5

1.1 converted to http proxy

go run ss2http.go --proxy_type http

2. proxy for python script

pip install PySocks

psutil
pytest
pylint
flake8
import urllib2
import socks
from sockshandler import SocksiPyHandler

opener = urllib2.build_opener(SocksiPyHandler(socks.SOCKS5, "127.0.0.1", 30080))
#x = opener.open("http://www.youtube.com/")
x = opener.open("http://www.google.com")
print x.read()

using shadowsocks to setup a proxy server

cat /etc/shadowsocks.json
{
"server":"xxxx.com",
"server_port":10008,
"local_port":1080,
"password":"123456",
"timeout":600,
"method":"aes-256-cfb"
}

sslocal -c /etc/shadowsocks.json -d start

Reference

上一篇 下一篇

猜你喜欢

热点阅读