0%

使用Docker部署XRay服务

XRay是一款原生支持XTLS黑科技且源自V2Ray却超越V2Ray的科学上网工具。

服务部署

docker-compose.yml文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
version: '3.7'

services:
xray:
image: teddysun/xray
restart: always
labels:
- traefik.http.routers.xray.rule=Host(`xray.yourdomain.com`) && Path(`/vxknSD77hYanwwRM`)
- traefik.http.routers.xray.entrypoints=websecure
- traefik.http.routers.xray.service=xray
- traefik.http.services.xray.loadbalancer.server.port=9000
volume:
- ./config.json:/etc/xray/config.json

config.json文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"inbound": {
"port": 9000,
"protocol": "vmess",
"settings": {
"clients": [{ "id": "01605FB4-129A-4673-BDD8-D7BC592B404A" }]
},
"streamSettings": {
"network": "ws",
"wsSettings": { "path": "/vxknSD77hYanwwRM" }
}
},
"outbound": { "protocol": "freedom" }
}

客户端配置

下载并安装客户端,按以下内容进行配置:

  • id: 01605FB4-129A-4673-BDD8-D7BC592B404A
  • wss://xray.yourdomain.com/vxknSD77hYanwwRM