Proxy
代理的配置,支持协议 Shadowsocks,Trojan,Hysteria2,TUIC,SOCKS5,HTTP,Vmess,Vless。所有字段中 bool 类型的可选值默认为 false。
Shadowsocks
-
name (string), 必填
代理名称,需在全局唯一。
-
method (string), 必填
加密方式。
AEAD-2022:
2022-blake3-aes-128-gcm,2022-blake3-aes-256-gcm,2022-blake3-chacha20-poly1305AEAD:
chacha20-poly1305,aes-256-gcm,aes-128-gcm,Stream:
none,table,rc4,rc4-md5,aes-128-cfb,aes-192-cfb,aes-256-cfb,aes-128-ctr,aes-192-ctr,aes-256-ctr,bf-cfb,camellia-128-cfb,camellia-192-cfb,camellia-256-cfb,cast5-cfb,des-cfb,idea-cfb,rc2-cfb,seed-cfb,salsa20,chacha20,chacha20-ietf。 -
password (string), 必填
密码。
-
server (string), 必填
服务器地址,可为 IP 或域名。
-
port (integer), 必填
服务器端口。
-
tfo (bool), 可选
是否开启 TCP Fast Open。
-
udp_relay (bool), 可选
是否开启 UDP 转发功能。
-
obfs (string), 可选
混淆方式。可选值
http,tls。 -
obfs_host (string), 可选
混淆时用到的主机名。
-
obfs_uri (string), 可选
混淆时的 URI 路径。
-
prev_hop (string), 可选
当前代理的上一跳代理或策略组名称。
配置示例:
shadowsocks:
name: "my-ss"
method: "aes-256-gcm"
password: "mypassword"
server: "1.2.3.4"
port: 8388
tfo: true
udp_relay: false
obfs: "http"
obfs_host: "example.com"
obfs_uri: "/path"
Trojan
-
name (string), 必填
代理名称,需在全局唯一。
-
server (string), 必填
服务器地址,可为 IP 或域名。
-
port (integer), 必填
服务器端口。
-
sni (string), 可选
用于 TLS 的服务器名称指示(SNI)。
-
password (string), 必填
Trojan 协议的密码。
-
tfo (bool), 可选
是否开启 TCP Fast Open。
-
udp_relay (bool), 可选
是否开启 UDP 转发功能。
-
skip_tls_verify (bool), 可选
是否跳过 TLS 证书验证。
-
websocket (object), 可选
Trojan 的 WebSocket 配置:
-
path (string), 必填
WebSocket 路径。
-
host (string), 可选
WebSocket 头部的 Host。
-
-
prev_hop (string), 可选
当前代理的上一跳代理或策略组名称。
配置示例:
trojan:
name: "my-trojan"
server: "trojan.example.com"
port: 443
sni: "trojan.example.com"
password: "trojanpass"
tfo: true
udp_relay: true
skip_tls_verify: true
websocket:
path: "/ws"
host: "trojan.example.com"
Hysteria2
-
name (string), 必填
代理名称,需在全局唯一。
-
server (string), 必填
服务器地址,可为 IP 或域名。
-
port (integer), 必填
服务器端口。
-
auth (string), 必填
用于 Hysteria2 的验证密码或令牌。
-
sni (string), 可选
用于 TLS 的服务器名称指示(SNI)。
-
obfs (string), 可选
混淆方式。可选值
salamander。 -
obfs_password (string), 可选
混淆密码。
-
skip_tls_verify (bool), 可选
是否跳过 TLS 证书验证。
-
port_hopping (string), 可选
端口跳跃配置字符串。支持
443,8000-9000这种格式。 -
port_hopping_interval (integer), 可选
端口跳跃间隔(秒)。
-
prev_hop (string), 可选
当前代理的上一跳代理或策略组名称。
配置示例:
hysteria2:
name: "my-hysteria2"
server: "hysteria.example.com"
port: 443
auth: "my_auth_token"
sni: "hysteria.example.com"
obfs: "myobfs"
obfs_password: "myobfspass"
skip_tls_verify: true
port_hopping: "443-447"
port_hopping_interval: 60
TUIC
-
name (string), 必填
代理名称,需在全局唯一。
-
server (string), 必填
服务器地址,可为 IP 或域名。
-
port (integer), 必填
服务器端口。
-
uuid (string), 必填
UUID。
-
password (string), 必填
密码。
-
udp_relay_mode (string), 可选
UDP 转发模式。
native,quic。 -
alpn (array of string), 可选
TLS 的 ALPN 列表。
-
sni (string), 可选
用于 TLS 的服务器名称指示(SNI)。
-
skip_tls_verify (bool), 可选
是否跳过 TLS 证书验证。
-
port_hopping (string), 可选
端口跳跃配置字符串。支持
443,8000-9000这种格式。 -
port_hopping_interval (integer), 可选
端口跳跃间隔(秒)。
-
prev_hop (string), 可选
当前代理的上一跳代理或策略组名称。
配置示例:
tuic:
name: "my-tuic"
server: "tuic.example.com"
port: 443
uuid: "22222222-2222-2222-2222-222222222222"
password: "tuicpass"
udp_relay_mode: "native"
alpn:
- "h2"
- "http/1.1"
sni: "tuic.example.com"
skip_tls_verify: true
port_hopping: "443,445,447"
port_hopping_interval: 30
SOCKS5
-
name (string), 必填
代理名称,需在全局唯一。
-
server (string), 必填
服务器地址,可为 IP 或域名。
-
port (integer), 必填
服务器端口。
-
username (string), 可选
用户名。
-
password (string), 可选
密码。
-
tfo (bool), 可选
是否开启 TCP Fast Open。
-
udp_relay (bool), 可选
是否开启 UDP 转发功能。
-
prev_hop (string), 可选
当前代理的上一跳代理或策略组名称。
配置示例:
socks5:
name: "my-socks5"
server: "1.2.3.4"
port: 1080
username: "user"
password: "pass"
tfo: false
udp_relay: true
HTTP
-
name (string), 必填
代理名称,需在全局唯一。
-
server (string), 必填
服务器地址,可为 IP 或域名。
-
port (integer), 必填
服务器端口。
-
username (string), 可选
HTTP 代理的用户名。
-
password (string), 可选
HTTP 代理的密码。
-
tfo (bool), 可选
是否开启 TCP Fast Open。
-
prev_hop (string), 可选
当前代理的上一跳代理或策略组名称。
配置示例:
http:
name: "my-http"
server: "5.6.7.8"
port: 8080
username: "user"
password: "pass"
tfo: false
Vmess
-
name (string), 必填
代理名称,需在全局唯一。
-
server (string), 必填
服务器地址,可为 IP 或域名。
-
port (integer), 必填
服务器端口。
-
user_id (string), 必填
Vmess 用户 ID(UUID)。
-
security (string), 必填
加密方式。
auto,aes-128-gcm,chacha20-poly1305,none,zero -
legacy (bool), 可选
是否使用旧格式的 Vmess 协议。
-
tfo (bool), 可选
是否开启 TCP Fast Open。
-
udp_relay (bool), 可选
是否开启 UDP 转发功能。
-
transport (object), 可选
传输协议配置,详见 Vmess Transport。
-
prev_hop (string), 可选
当前代理的上一跳代理或策略组名称。
配置示例:
vmess:
name: "my-vmess"
server: "vmess.example.com"
port: 443
user_id: "00000000-0000-0000-0000-000000000000"
security: "auto"
legacy: false
tfo: true
udp_relay: true
transport:
ws:
path: "/myws"
headers:
Host: "vmess.example.com"
Vless
-
name (string), 必填
代理名称,需在全局唯一。
-
server (string), 必填
服务器地址,可为 IP 或域名。
-
port (integer), 必填
服务器端口。
-
user_id (string), 必填
Vless 用户 ID(UUID)。
-
tfo (bool), 可选
是否开启 TCP Fast Open。
-
udp_relay (bool), 可选
是否开启 UDP 转发功能。
-
transport (object), 可选
传输协议配置,详见 Vmess Transport。
-
prev_hop (string), 可选
当前代理的上一跳代理或策略组名称。
配置示例:
vless:
name: "my-vless"
server: "vless.example.com"
port: 443
user_id: "11111111-1111-1111-1111-111111111111"
tfo: true
udp_relay: false
transport:
wss:
path: "/vlessws"
sni: "vless.example.com"
headers:
Custom-Header: "MyValue"
Vmess Transport
在 Vmess、Vless 代理类型的 transport 字段中使用。可选值及示例配置如下:
-
HTTP 1
transport:
http1:
method: "GET"
path: "/"
headers:
User-Agent: "curl/7.77.0"
Accept: "*/*" -
HTTP 2
transport:
http2:
method: "GET"
path: "/"
headers:
User-Agent: "curl/7.77.0"
Accept: "*/*"
skip_tls_verify: true -
Tls
transport:
tls:
sni: "my-sni.example.com"
skip_tls_verify: true -
Wss
transport:
wss:
path: "/websocket"
headers:
Host: "myhost.example.com"
sni: "my-sni.example.com"
skip_tls_verify: false -
Ws
transport:
ws:
path: "/ws"
headers:
Host: "myhost.example.com"