2023-01-02 04:39:37 +00:00
{
"log": {
"loglevel": "info"
},
2023-01-28 04:17:42 +00:00
"api": {
"services": [
"HandlerService",
"LoggerService",
"StatsService"
],
"tag": "api"
},
"stats": {},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true,
"statsOutboundUplink": true,
"statsOutboundDownlink": true
}
},
2023-01-02 04:39:37 +00:00
"inbounds": [
2023-01-28 04:17:42 +00:00
{
"listen": "127.0.0.1",
"port": 62789,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api",
"sniffing": null
},
2023-01-02 04:39:37 +00:00
{
2023-01-11 04:35:01 +00:00
"tag": "Vless-TCP-XTLS",
2023-01-02 04:39:37 +00:00
"port": 443, // This is TLS entrypoint. This entrypoint does the SSL Termination then routes the request based on the Path or ALPN type.
2023-01-11 04:35:01 +00:00
"protocol": "vless",
2023-01-02 04:39:37 +00:00
"settings": {
"clients": [
2023-01-28 04:17:42 +00:00
{ "email": "general@vless-tcp-xtls", //Change to your own email
"id": "90e4903e-66a4-45f7-abda-fd5d5ed7f797", //Change to your own email
"flow": "xtls-rprx-vision",
"level": 0
2023-01-11 04:35:01 +00:00
// "flow": "xtls-rprx-direct"
2023-01-02 04:39:37 +00:00
}
],
"decryption": "none",
"fallbacks": [
2023-01-11 04:35:01 +00:00
// H2
{
// if the SNI was `trh2o.EXAMPLE.COM` and `alpn=h2`, pass it to trojan-h2 listener
"name": "trh2o.example.com",
"alpn": "h2",
"dest": "@trojan-h2"
},
{
// if the SNI was `vlh2o.EXAMPLE.COM` and `alpn=h2`, pass it to vless-h2 listener
"name": "vlh2o.example.com",
"alpn": "h2",
"dest": "@vless-h2"
},
2023-01-02 04:39:37 +00:00
{
2023-01-11 04:35:01 +00:00
// if the SNI was `vmh2o.EXAMPLE.COM` and `alpn=h2`, pass it to vmess-h2 listener
"name": "vmh2o.example.com",
"alpn": "h2",
"dest": "@vmess-h2"
},
{
// if the SNI was `ssh2o.EXAMPLE.COM` and `alpn=h2`, pass it to shadowsocks-h2 listener
"name": "ssh2o.example.com",
"alpn": "h2",
"dest": 4003
},
// Websocket
{
// if the path was `/vlws`, pass it to vless-ws listener
"path": "/vlws",
2023-01-02 04:39:37 +00:00
"dest": "@vless-ws",
"xver": 2 //Enable the sending of the PROXY protocol, and send the real source IP and port to the following vmess+ws application. 1 or 2 indicates the PROXY protocol version. Consistent with the following, it is recommended to configure 2.
},
{
2023-01-11 04:35:01 +00:00
// if the path was `/vmws`, pass it to vmess-ws listener
"path": "/vmws",
2023-01-02 04:39:37 +00:00
"dest": "@vmess-ws",
"xver": 2
},
{
// if the path was `/trojanws`, pass it to trojan-ws listener
"path": "/trojanws",
"dest": "@trojan-ws",
"xver": 2
},
2023-01-11 04:35:01 +00:00
{
// if the path was `/ssws`, pass it to port 4001 (shadowsocks-ws listener)
"path": "/ssws",
"dest": 4001
},
// TCP + http obfs
2023-01-02 04:39:37 +00:00
{
// if the path was `/vltc`, pass it to vless-tcp listener
"path": "/vltc",
"dest": "@vless-tcp",
"xver": 2
},
{
// if the path was `/vmtc`, pass it to vmess-tcp listener
"path": "/vmtc",
"dest": "@vmess-tcp",
"xver": 2
},
2023-01-11 04:35:01 +00:00
{
// if the path was `/sstc`, pass it to port 4002 (shadowsocks-tcp listener)
"path": "/sstc",
"dest": 4002
},
2023-01-02 04:39:37 +00:00
{
// if the request's ALPN was HTTP2, pass it to trojan-tcp. (Also from trojan-tcp fallback to Nginx HTTP2)
"alpn": "h2",
"dest": "@trojan-tcp",
"xver": 2
},
{
// if not any other condition, pass it to Nginx HTTP1.1 listener
"dest": "/dev/shm/h1.sock",
"xver": 2
}
]
},
"streamSettings": {
"network": "tcp",
2023-01-11 04:35:01 +00:00
// If XTLS Vision is enabled, "security" must be "tls"
// If XTLS Direct is enabled, "security" must be "xtls"
"security": "tls",
// If XTLS Direct is enabled, "tlsSettings" should also be changed to "xtlsSettings"
"tlsSettings": {
2023-01-02 04:39:37 +00:00
"certificates": [
{
"ocspStapling": 3600, //The Xray version is not less than v1.3.0 to support configuring the time interval between OCSP stapling update and certificate hot reload. Currently V2Ray does not support it. If you use V2Ray as the server, you must delete this configuration.
"certificateFile": "/etc/ssl/example.com/domain.pem", // this is te fullchain (domain + any bundle). Make sure the permissions are correct (absolute path)
"keyFile": "/etc/ssl/example.com/domain-key.pem" // this is the private key of the cert. Make sure the permissions are correct (absolute path)
},
{
// more domains and therefore more certificates can be added to this `certificates` list
"ocspStapling": 3600,
"certificateFile": "/etc/ssl/behindcdn.com/domain.pem",
"keyFile": "/etc/ssl/behindcdn.com/domain-key.pem"
}
],
"minVersion": "1.2", //Xray version is not less than v1.1.4 to support configuring the minimum TLS version. Currently V2Ray does not support it. If you use V2Ray as the server, you must delete this configuration.
"cipherSuites": "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", //Xray版本不小于v1.1.4才支持配置密码套件( 若无RSA证书, 可删除所有RSA算法的密码套件; 无ECC证书, to remove cipher suites for all ECDSA algorithms.). Currently V2Ray does not support it. If you use V2Ray as the server, you must delete this configuration.
"alpn": [
"h2", //Enabling h2 connection needs to configure h2 fallback, otherwise inconsistency (streaking) is easily detected by the wall and blocked.
"http/1.1" //Enabling http/1.1 connection needs to configure http/1.1 fallback, otherwise inconsistency (streaking) is easily detected by the wall and blocked.
]
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-02 04:39:37 +00:00
}
},
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2023-01-11 04:35:01 +00:00
// WebSocket (VLESS - VMESS - TROJAN - ShadowSocks) //
2023-01-02 04:39:37 +00:00
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
{
"listen": "@vless-ws",
"protocol": "vless",
"settings": {
"clients": [
2023-01-28 04:17:42 +00:00
{ "email":"general@vless-ws", //Change to your own email
"id": "90e4903e-66a4-45f7-abda-fd5d5ed7f797", //Change to your own UUID
"level": 0
2023-01-02 04:39:37 +00:00
}
],
"decryption": "none"
},
"streamSettings": {
"network": "ws",
"security": "none",
"wsSettings": {
"acceptProxyProtocol": true,
2023-01-11 04:35:01 +00:00
"path": "/vlws"
2023-01-02 04:39:37 +00:00
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-02 04:39:37 +00:00
}
},
{
"listen": "@vmess-ws",
"protocol": "vmess",
"settings": {
"clients": [
{
2023-01-28 04:17:42 +00:00
"email": "general@vmess-ws",
2023-01-02 04:39:37 +00:00
"id": "90e4903e-66a4-45f7-abda-fd5d5ed7f797",
"level": 0
}
]
},
"streamSettings": {
"network": "ws",
"security": "none",
"wsSettings": {
"acceptProxyProtocol": true,
2023-01-11 04:35:01 +00:00
"path": "/vmws"
2023-01-02 04:39:37 +00:00
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-02 04:39:37 +00:00
}
},
{
"listen": "@trojan-ws", //trojan+ws listener process
"protocol": "trojan",
"settings": {
"clients": [
{
2023-01-28 04:17:42 +00:00
"email":"general@trojan-ws",
2023-02-17 14:42:05 +00:00
"password": "desdemona99",
2023-01-28 04:17:42 +00:00
"level": 0
2023-01-02 04:39:37 +00:00
}
]
},
"streamSettings": {
"network": "ws",
"security": "none",
"wsSettings": {
"acceptProxyProtocol": true, //Enable PROXY protocol reception, receive the real source IP and port
"path": "/trojanws" //Change to your own path
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-02 04:39:37 +00:00
}
},
2023-01-11 04:35:01 +00:00
{
"tag": "shadowsocks-ws",
"listen": "127.0.0.1",
"port": 4001,
"protocol": "shadowsocks",
"settings": {
2023-01-28 04:17:42 +00:00
"email":"general@shadowsocks-ws",
2023-01-11 04:35:01 +00:00
"method": "chacha20-ietf-poly1305",
2023-01-28 04:17:42 +00:00
"password": "desdemona99",
"level": 0
2023-01-11 04:35:01 +00:00
},
"streamSettings": {
"network": "ws",
"security": "none",
"wsSettings": {
"path": "/ssws"
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-11 04:35:01 +00:00
}
},
2023-01-02 04:39:37 +00:00
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2023-01-11 04:35:01 +00:00
// TCP + http obfs (VLESS - VMESS - TROJAN - ShadowSocks) //
2023-01-02 04:39:37 +00:00
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
{
"listen": "@trojan-tcp", //trojan+tcp listening process
"protocol": "trojan",
"settings": {
"clients": [
{
2023-01-28 04:17:42 +00:00
"email":"general@trojan-tcp",
"password": "desdemona99",
"level": 0
2023-01-02 04:39:37 +00:00
}
],
"fallbacks": [
{
// if it was not a valid trojan reuqest, for example the trojan password was wrong, pass it to the NGINX HTTP2 cleartext UDS
"dest": "/dev/shm/h2c.sock",
"xver": 2 //Enable PROXY protocol sending, and send the real source IP and port to Nginx. 1 or 2 indicates the PROXY protocol version. Consistent with the above, configuration 2 is recommended.
}
]
},
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {
"acceptProxyProtocol": true //Enable PROXY protocol reception, receive the real source IP and port before vless+tcp+tls fallback.
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-02 04:39:37 +00:00
}
},
{
"listen": "@vless-tcp",
"protocol": "vless",
"settings": {
"clients": [
{
2023-01-28 04:17:42 +00:00
"email":"general@vless-tcp",
"id": "90e4903e-66a4-45f7-abda-fd5d5ed7f797",
"level": 0
2023-01-02 04:39:37 +00:00
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {
"acceptProxyProtocol": true,
"header": {
"type": "http",
"request": {
2023-01-28 04:17:42 +00:00
"path": [
"/vltc"
]
2023-01-02 04:39:37 +00:00
}
}
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-02 04:39:37 +00:00
}
},
{
"listen": "@vmess-tcp",
"protocol": "vmess",
"settings": {
"clients": [
{
2023-01-28 04:17:42 +00:00
"email":"general@vmess-tcp",
2023-01-02 04:39:37 +00:00
"id": "90e4903e-66a4-45f7-abda-fd5d5ed7f797",
"level": 0
}
]
},
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {
"acceptProxyProtocol": true,
"header": {
"type": "http",
"request": {
2023-01-28 04:17:42 +00:00
"path": [
"/vmtc"
] //,
2023-01-02 04:39:37 +00:00
// "headers": {
// "Host": ["www.varzesh3.com"]
// }
}
}
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-02 04:39:37 +00:00
}
},
2023-01-11 04:35:01 +00:00
{
"tag": "shadowsocks-tcp",
"listen": "127.0.0.1",
"port": 4002,
"protocol": "shadowsocks",
"settings": {
"method": "chacha20-ietf-poly1305",
2023-01-28 04:17:42 +00:00
"password": "desdemona99",
"email": "general@shadowsocks-tcp",
"level":0
2023-01-11 04:35:01 +00:00
},
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {
"header": {
"type": "http",
"request": {
2023-01-28 04:17:42 +00:00
"path": [
"/sstc"
]
2023-01-11 04:35:01 +00:00
}
}
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-11 04:35:01 +00:00
}
},
2023-01-02 04:39:37 +00:00
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// GRPC (VLESS - VMESS - TROJAN - SHADOWSOCKS) (Nginx routes to them based on `serviceName`(HTTP2 Path) ) //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
{
"tag": "trojan-grpc",
"listen": "127.0.0.1", // listen on localhost
"port": 3001,
"protocol": "trojan",
"settings": {
"clients": [
2023-01-28 04:17:42 +00:00
{
"email": "general@trojan-grpc",
"password": "desdemona99",
"level":0
2023-01-02 04:39:37 +00:00
}
]
},
"streamSettings": {
"network": "grpc",
"security": "none",
"grpcSettings": {
"serviceName": "trgrpc"
}
}
},
{
"tag": "vless-grpc",
"listen": "127.0.0.1", // listen on localhost
"port": 3002,
"protocol": "vless",
"settings": {
"clients": [
{
2023-01-28 04:17:42 +00:00
"email":"general@vless-grpc",
"id": "90e4903e-66a4-45f7-abda-fd5d5ed7f797",
"level": 0
2023-01-02 04:39:37 +00:00
}
],
"decryption": "none"
},
"streamSettings": {
"network": "grpc",
"security": "none",
"grpcSettings": {
"serviceName": "vlgrpc"
}
}
},
{
"tag": "vmess-grpc",
"listen": "127.0.0.1", // listen on localhost
"port": 3003,
"protocol": "vmess",
"settings": {
"clients": [
{
2023-01-28 04:17:42 +00:00
"email":"general@vmess-grpc",
2023-01-02 04:39:37 +00:00
"id": "90e4903e-66a4-45f7-abda-fd5d5ed7f797", //Change to your own UUID
"level": 0
}
]
},
"streamSettings": {
"network": "grpc",
"security": "none",
"grpcSettings": {
"serviceName": "vmgrpc"
}
}
},
{
"listen": "127.0.0.1", //Only listen on localhost
"port": 3004,
"protocol": "shadowsocks",
"settings": {
"method": "chacha20-ietf-poly1305",
"password": "desdemona99", //Change to your own password
"email": "2011@gmail.com"
},
"streamSettings": {
"network": "grpc",
"security": "none",
"grpcSettings": {
"serviceName": "ssgrpc" //Change to your own gRPC service name, similar to Path in HTTP/2.
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-02 04:39:37 +00:00
}
2023-01-11 04:35:01 +00:00
},
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// H2 (VLESS - VMESS - TROJAN - SHADOWSOCKS) //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
{
"listen": "@trojan-h2",
"protocol": "trojan",
"settings": {
"clients": [
2023-01-28 04:17:42 +00:00
{
"email":"general@trojan-h2",
"password": "desdemona99",
"level": 0
2023-01-11 04:35:01 +00:00
}
]
},
"streamSettings": {
"network": "h2",
"security": "none",
"httpSettings": {
"path": "/trh2"
}
}
},
{
"listen": "@vless-h2",
"protocol": "vless",
"settings": {
"clients": [
{
2023-01-28 04:17:42 +00:00
"email":"general@vless-h2", //Change to your own email
"id": "90e4903e-66a4-45f7-abda-fd5d5ed7f797", //Change to your own UUID
"level": 0
2023-01-11 04:35:01 +00:00
}
],
"decryption": "none"
},
"streamSettings": {
"network": "h2",
"security": "none",
"httpSettings": {
"path": "/vlh2"
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-11 04:35:01 +00:00
}
},
{
"listen": "@vmess-h2",
"protocol": "vmess",
"settings": {
"clients": [
2023-01-28 04:17:42 +00:00
{
"email":"general@vmess-h2",
2023-01-11 04:35:01 +00:00
"id": "90e4903e-66a4-45f7-abda-fd5d5ed7f797",
"level": 0
}
]
},
"streamSettings": {
"network": "h2",
"security": "none",
"httpSettings": {
"path": "/vmh2"
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-11 04:35:01 +00:00
}
},
{
"tag": "shadowsocks-h2",
"listen": "127.0.0.1",
"port": 4003,
"protocol": "shadowsocks",
"settings": {
"method": "chacha20-ietf-poly1305",
"password": "desdemona99", //Change to your own password
2023-01-28 04:17:42 +00:00
"email": "general@shadowsocks-h2",
"level": 0
2023-01-11 04:35:01 +00:00
},
"streamSettings": {
"network": "h2",
"security": "none",
"httpSettings": {
"path": "/ssh2"
}
},
"sniffing": {
"enabled": true,
2023-01-28 04:17:42 +00:00
"destOverride": [
"http",
"tls"
]
2023-01-11 04:35:01 +00:00
}
} //,
2023-01-02 04:39:37 +00:00
// {
2023-01-11 04:35:01 +00:00
// "port": 80, // this is http entrypoint, uncomment to enable vless-ws, vless-tcp, vmess-ws, v,ess-tcp, shadowwsocks-ws and shadowsocks-tcp on HTTP
2023-01-02 04:39:37 +00:00
// "protocol": "vless",
// "settings": {
// "clients": [
// {
// "id": "90e4903e-66a4-45f7-abda-fd5d5ed7f797"
// }
// ],
// "fallbacks": [
// {
2023-01-11 04:35:01 +00:00
// "path": "/vlws",
2023-01-02 04:39:37 +00:00
// "dest": "@vless-ws",
// "xver": 2
// },
// {
2023-01-11 04:35:01 +00:00
// "path": "/vmws",
2023-01-02 04:39:37 +00:00
// "dest": "@vmess-ws", // the same vmess-ws used in 443 TLS entrypint is used here as well
// "xver": 2
// },
// {
// "path": "/vltc",
// "dest": "@vless-tcp",
// "xver": 2
// },
// {
// "path": "/vmtc",
// "dest": "@vmess-tcp",
// "xver": 2
// },
// {
// "dest": "/dev/shm/h1.sock", // defaults to Nginx HTTP1.1 listener
// "xver": 2
2023-01-11 04:35:01 +00:00
// },
// {
// "path": "/ssws",
// "dest": 4001
// },
// {
// "path": "/sstc",
// "dest": 4002
2023-01-02 04:39:37 +00:00
// }
// ],
// "decryption": "none"
// },
// "streamSettings": {
// "network": "tcp",
// "security": "none"
// },
// "sniffing": {
// "enabled": true,
// "destOverride": ["http", "tls"]
// }
// }
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
},
{
"protocol": "blackhole",
2023-01-28 04:17:42 +00:00
"tag": "blocked"
2023-01-02 04:39:37 +00:00
},
{
// A DNS Cache can be setup and added here to imporve performance (the corresponding rule should be uncommented)
"tag": "DNS-Internal",
"protocol": "dns",
"settings": {
"address": "127.0.0.53",
"port": 53
}
}
],
"routing": {
"domainStrategy": "AsIs",
2023-01-28 04:17:42 +00:00
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
// {
// // DNS Cache rule
// "type": "field",
// "port": 53,
// "network": "tcp,udp",
// "outboundTag": "DNS-Internal"
// },
{
"type": "field",
"outboundTag": "blocked",
"ip": [
"geoip:private"
]
},
{
"type": "field", // Block BitTorrent protocol
"outboundTag": "blocked",
"protocol": [
"bittorrent"
]
}
]
2023-01-02 04:39:37 +00:00
}
2023-01-28 04:17:42 +00:00
}