在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
{ | |
"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" | |
], |
let github2jsdelivr = (_url) => { | |
regex = {"blob": /(.+)github.com\/(.+)\/(.+)\/blob\/(.+)\/(.+)/, | |
"tree": /(.+)github.com\/(.+)\/(.+)\/blob\/(.+)\/(.+)/}; | |
if(_url.match(regex.tree)){ | |
return _url.replace(regex.tree, "$1cdn.jsdelivr.net/gh/$2/$3@$4/$5"); | |
}else if(_url.match(regex.blob)){ | |
return _url.replace(regex.blob, "$1cdn.jsdelivr.net/gh/$2/$4@$4/$5"); | |
}else{ | |
return _url; | |
} |
// 需要反代的地址 | |
const upstream = 'api.github.com' | |
// 反代地址的子路径 | |
const upstreamPath = '/' | |
// 反代网站的移动端域名 | |
const upstreamMobile = 'api.github.com' | |
// 是否使用 https | |
const useHttps = true |
version: '3.5' | |
services: | |
shlink-frontend: | |
image: shlinkio/shlink-web-client:stable | |
container_name: shlink-frontend | |
restart: unless-stopped | |
depends_on: | |
- shlink-backend | |
- shlink-db |
#!/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" |
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 |
#!/bin/bash | |
zone_name=$1 | |
record_name=$2 | |
api_key=$3 | |
current_ip=`curl -s https://api.ipify.org` | |
zone_id=`curl -s -X GET "https://api.cloudflare.com/client/v4/zones" \ | |
-H "Authorization: Bearer ${api_key}" -H "Content-Type: application/json" \ | |
| jq -r ".result | .[] | select(.name == \"${zone_name}\") | .id"` |
# HTTP, SOCKS5 混合端口 | |
mixed-port: 7890 | |
# 允许局域网的连接(可用来共享代理) | |
allow-lan: true | |
# 规则模式:Rule(规则) / Global(全局代理)/ Direct(全局直连) | |
mode: Rule | |
# 设置日志输出级别 (默认级别:info,级别越高日志输出量越大,越倾向于调试) |