Shadowsocks + simple-obfs + IPv6 [CentOS 7]
Sometimes, the network traffic need to be encrypted and obfuscated. shadowsocks + simple-obfs is a simple solution.
shadowsocks is a socks5 proxy, with traffic encryption. all traffic through shadosocks will be encrypted.
simple-obfs is used for obfuscate traffic. The upstream traffic encapsulation in HTTP or tls stream. The outer traffic will look like an HTTP session.
Server-side config
Install shadowsocks, simple-obfs
Enable copr and install:
1 | curl https://copr.fedorainfracloud.org/coprs/antonchen/proxy/repo/epel-7/antonchen-proxy-epel-7.repo \ |
Config shadowsocks:
1 | cat /etc/shadowsocks-libev/config.json |
server with value ["[::1]", "127.0.0.1"]
means listen 127.0.0.1 and ::1
(localhost in IPv6), not listen all interface.
fast_open means use TCP Fast Open, but with plugin, so actually 8888 is listened by obfs_-server, so we add fast-open=true to plugin_opts.
ipv6_first means while proxying DNS request, use IPv6 firstly. When you access google.com via proxy, you will use IPv6.
Start it, and make it autostart:
1 | systemctl start shadowsocks-libev |
Then,
Use nginx as reverse proxy
1 | cat /etc/nginx/conf.d/ss.conf |
Request without Upgrade
header will redirect to www.example.com, behave like a normal site.
Request with Upgrade is send by obfs-local, so proxy_pass to obfs-server.
You might need to configure firewall. For firewalld:
1 | firewall-cmd --permanent --add-service http |
Client config
macOS
Install shadowsocks-libev, simple-obfs:
brew install shadowsocks-libev simple-obfs
Configure it:
1 | cat /usr/local/etc/shadowsocks-libev.json |
Start ss-local:
1 | brew services start shadowsocks-libev |
You could now use 127.0.0.1:1080
as socks5 proxy.
Android
You need install shadowsocks-android, and simple-obfs-android.
Configure it:
Bonus
- You can use CDN that support WebSocket as a middle reverse proxy. for example, Cloudflare, 加速乐 by 知道创宇.
- You can put your site and obfs under same domain.
Shadowsocks + simple-obfs + IPv6 [CentOS 7]
https://robberphex.com/shadowsocks-simple-obfs-ipv6-centos-7/