这应该是目前理论最隐蔽的代理方式,走的是真正意义上的https
流量,是实际的网站流量,当然前提是你有一个网站,不过没有也没关系,只不过比较假而已 ::(滑稽)
V2ray
服务端配置
配置文件位于/etc/v2ray/config.json
,示例配置如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| { "inbounds": [ { "port": 10086, "listen":"127.0.0.1", "protocol": "vmess", "settings": { "clients": [ { "id": "792c270e-2712-4efe-aa2f-a0578b120a78", "alterId": 64 } ] }, "streamSettings": { "network": "ws", "wsSettings": { "path": "/v2ray" } } } ], "outbounds": [ { "protocol": "freedom", "settings": {} } ] }
|
Nginx
反向代理配置
示例配置
1 2 3 4 5 6 7 8
| location /v2ray { proxy_redirect off; proxy_pass http: proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; }
|
当然这部分需要加到配置https的部分
需要注意的是,你的需要确保网站不会拦截到https://yourdomain/v2ray
的请求,因为某些网站模板会直接返回一个自定义的404页面,导致无法使用代理,我踩过的坑不希望别人再踩
V2ray
客户端配置
示例配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| { "inbounds": [ { "port": 1080, "listen": "127.0.0.1", "protocol": "socks", "domainOverride": ["tls","http"], "settings": { "auth": "noauth", "udp": true } } ], "outbounds": [ { "protocol": "vmess", "settings": { "vnext": [ { "address": "yourdomain", "port": 443, "users": [ { "id": "792c270e-2712-4efe-aa2f-a0578b120a78", "alterId": 64 } ] } ] }, "streamSettings": { "network": "ws", "security": "tls", "wsSettings": { "path": "/v2ray" } } } ] }
|
使用V2ray
集成的shadowsocks
由于V2ray
的安卓客户端极其难用,bug也多,所以在手机上还是使用shadowsocks
,但是shadowsocks
的配置就比较简单了
示例配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| { "inbounds": [ { "port": 12315, "protocol": "shadowsocks", "settings": { "method": "aes-256-gcm", "ota": true, "password": "password" } } ], "outbounds": [ { "protocol": "freedom", "settings": {} } ] }
|
把两种方案结合一下,最后就是这样的配置了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| { "inbounds": [ { "port": 10086, "listen":"127.0.0.1", "protocol": "vmess", "settings": { "clients": [ { "id": "792c270e-2712-4efe-aa2f-a0578b120a78", "alterId": 64 } ] }, "streamSettings": { "network": "ws", "wsSettings": { "path": "/v2ray" } } }, { "port": 12315, "protocol": "shadowsocks", "settings": { "method": "aes-256-gcm", "ota": true, "password": "password" } } ], "outbounds": [ { "protocol": "freedom", "settings": {} } ] }
|
参考:https://toutyrater.github.io/