V2ray_WS+TLS+Web
可谁还记得我呢
发表于 2020-5-7
# V2ray WS+TLS+Web **记一次安装v2经历。** ## 安装v2ray 参考官方文档https://v2ray.com/ 安装前请校准服务端与客户端时间。 Linux安装脚本 ``` bash <(curl -L -s https://install.direct/go.sh) ``` ## 服务端配置 + `/etc/v2ray/config.jso` : 配置文件位置; + `/usr/bin/v2ray/v2ctl uuid`:输出一个随机的 UUID。 ``` { "inbounds": [ { "port": 12345, "listen":"127.0.0.1", "protocol": "vmess", "settings": { "clients": [ { "id": "b831381d-6324-4d53-ad4f-8cda48b30811", "alterId": 64, } ] }, "streamSettings": { "network": "ws", "wsSettings": { "path": "/" } } } ], "outbounds": [ { "protocol": "freedom", "settings": {} } ] } ``` ## 安装配置Web服务 理论上任何Web服务都行,这里采用了Nginx。 在Nginx配置文件内加入反代配置,如下 ``` #ws location / { proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_intercept_errors on; if ($http_upgrade = "websocket" ){ proxy_pass http://127.0.0.1:12345; } } ``` SSL证书添加 + 使用宝塔直接添加Let's encrypt等证书; + 使用 acme.sh 脚本生成证书`https://get.acme.sh`; + 使用openssl生成自签名证书; + 其他 ## 客户端配置 ``` { "inbounds": [ { "port": 1080, "listen": "127.0.0.1", "protocol": "socks", "sniffing": { "enabled": true, "destOverride": ["http", "tls"] }, "settings": { "auth": "noauth", "udp": false } } ], "outbounds": [ { "protocol": "vmess", "settings": { "vnext": [ { "address": "mydomain.me", //修改为自己服务端的域名或地址 "port": 443, "users": [ { "id": "b831381d-6324-4d53-ad4f-8cda48b30811", "alterId": 64 } ] } ] }, "streamSettings": { "network": "ws", "security": "tls", "wsSettings": { "path": "/" } } } ] } ``` 地址填自己的域名,端口为443,id与服务端的相同,传输协议为ws,传输层安全tls启用,其他全为默认即可,如果有path则需填入path,上述配置中无需填入。 ## 2020.5.31 开始出现数个重大漏洞 请使用最新版本 https://github.com/v2ray/v2ray-core/issues/2542 ### 可以使用 如果你已经升级到 V2Ray v4.23.4,并且没有开启 TLS 的 AllowInsecure 选项,以下配置组合不会泄露识别信息: VMess over Websocket with TLS VMess over TLS VMess over HTTP/2 (使用 TLS 的 HTTP/2,并非 h2c) Shadowsocks(AEAD) over Websocket with TLS
ldeus
只是一个什么都做不到的普通人
友链
Powered by CloudFlare Workers |
Github
© 2020 ldeus' Blog