在v2ray+ws+tls+web的情况下,不管cloudflare dns有没有开启云朵(proxy),都可以透过address填cf节点ip,ws头部host填域名的方式连接上v2Ray服务器。写这篇的目的是想测试在没有web的情况下使用同一招,让同一个域名既能直连也能通过cdn中转。
地址: cloudflare.com (或1.1.1.1或任何cloudflare节点IP)
端口: web服务器的端口 (通常为443)
tls: 开
不安全连接: 不允许
混淆: websocket
| #!/bin/sh | |
| echo "Getting the latest version of trojan-go" | |
| latest_version="$(curl -s "https://api.github.com/repos/p4gefau1t/trojan-go/releases" | jq '.[0].tag_name' --raw-output)" | |
| echo "${latest_version}" | |
| trojango_link="https://github.com/p4gefau1t/trojan-go/releases/download/${latest_version}/trojan-go-linux-amd64.zip" | |
| mkdir -p "/usr/bin/trojan-go" | |
| mkdir -p "/etc/trojan-go" |
| { | |
| "run_type": "server", | |
| "local_addr": "127.0.0.1", | |
| "local_port": 443, | |
| "remote_addr": "1.1.1.1", | |
| "remote_port": 80, | |
| "log_level": 3, | |
| "password": [ | |
| "your_awesome_password" | |
| ], |
| [Unit] | |
| Description=MTG - Bullshit-free MTPROTO proxy for Telegram | |
| Documentation=https://github.com/9seconds/mtg | |
| After=network.target nss-lookup.target | |
| Wants=network-online.target | |
| [Service] | |
| Type=simple | |
| User=root | |
| ExecStart=/usr/local/bin/mtg run <secret> --bind 0.0.0.0:8443 |
| must.have.sni.com:80 { | |
| redir https://must.have.sni.com{uri} | |
| } | |
| must.have.sni.com:8080 { | |
| bind 127.0.0.1 | |
| root /var/www/html | |
| index index.html | |
| tls off | |
| } |
| #!/bin/bash | |
| site="www.your-ssl.com" | |
| path="/root/.acme.sh/acme-v02.api.letsencrypt.org/sites/${site}" | |
| touch server.key server.crt | |
| sudo cat "${path}/${site}.key" > "/root/server.key" | |
| sudo cat "${path}/${site}.crt" > "/root/server.crt" | |
| if [ -s "server.key" ] && [ -s "server.crt" ]; then |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| root /var/www/v2board/public; # 改成你自己的路径 | |
| index index.php index.html; | |
| server_name sspanel.host; # 改成你自己的域名 | |
| location / { | |
| try_files $uri $uri/ /index.php$is_args$query_string; | |
| } |
| type=v2board # 必填这个 | |
| server_type=v2ray # 必填这个 | |
| api=webapi # webapi 或 db,表示 webapi 对接或数据库对接 | |
| # webapi 对接 | |
| webapi_url=https://www.yourdomain.com/ # webapi url,填写面板主页地址 | |
| webapi_key= # webapi key | |
| node_id=1 # 节点id | |
| soga_key= # 授权key,社区版无需填写,最多支持88用户,商业版无限制 |
| scholar.example.com { | |
| timeouts 5m | |
| proxy / https://scholar.google.com.hk { | |
| except /robots.txt /usercontent | |
| header_upstream X-Real-IP {remote} | |
| header_upstream X-Forwarded-For {remote} | |
| header_upstream User-Agent {>User-Agent} | |
| # header_upstream X-Real-IP {>CF-Connecting-IP} | |
| # header_upstream X-Forwarded-For {>CF-Connecting-IP} | |
| header_upstream Accept-Language zh-HK |