安装Docker

配置VLESS服务器的步骤如下:

步骤1:安装VLESS

使用Docker安装VLESS:

# 拉取VLESS镜像
docker pull vless/vless:latest
# 启动VLESS服务器
docker run -d --name vless -p 301:301 -p 3011:3011 vless/vless:latest

步骤2:配置VLESS

方法1:使用配置文件

创建配置文件 vless.json:

{
  "server": {
    "name": "VLESS Server",
    "bind": "...:301",
    "port": 301,
    "ws": 3011,
    "wss": 8443,
    "security": {
      "enable": true,
      "verify": true,
      "cipher": "aes-256-cfb8",
      "curve": "secp256r1",
      "key": "your-encryption-key",
      "dh": {
        "prime": 4096,
        "rounds": 10
      }
    },
    "access": {
      "allow": [".../"],
      "enable": true
    },
    "forward": {
      "http": 8008,
      "https": 8443
    },
    "nat": {
      "enable": true,
      "socks": "socks5://localhost:108"
    },
    "ws": {
      "enable": true,
      "verify": true,
      "cipher": "aes-256-cfb8",
      "curve": "secp256r1",
      "key": "your-encryption-key"
    },
    "wss": {
      "enable": true,
      "verify": true,
      "cipher": "aes-256-cfb8",
      "curve": "secp256r1",
      "key": "your-encryption-key"
    }
  },
  "proxy": {
    "http": {
      "enable": true,
      "name": "HTTP Proxy",
      "listen": "...:8008",
      "transport": "tcp",
      "filter": {
        "type": "http",
        "header": [{
          "key": "Host",
          "value": ".*"
        }]
      }
    },
    "https": {
      "enable": true,
      "name": "HTTPS Proxy",
      "listen": "...:8443",
      "transport": "tcp",
      "filter": {
        "type": "https",
        "header": [{
          "key": "Host",
          "value": ".*"
        }]
      }
    }
  },
  "ws": {
    "enable": true,
    "name": "WebSocket Proxy",
    "listen": "...:3011",
    "transport": "ws",
    "filter": {
      "type": "ws",
      "header": [{
        "key": "Host",
        "value": ".*"
      }]
    }
  },
  "wss": {
    "enable": true,
    "name": "WSS Proxy",
    "listen": "...:8443",
    "transport": "wss",
    "filter": {
      "type": "wss",
      "header": [{
        "key": "Host",
        "value": ".*"
      }]
    }
  },
  "compression": {
    "enable": true,
    "type": "zstd",
    "level": 9
  },
  "trie": {
    "enable": true,
    "root": "trie_root",
    "max_size": 4096
  },
  "access-control": {
    "allow": ["*"],
    "enable": true
  }
}

将配置文件挂载到Docker容器内:

docker run -d --name vless -p 301:301 -p 3011:3011 -v /path/to/vless.json:vless/vless.json vless/vless:latest

方法2:使用VLESS配置界面

访问服务器地址:http://localhost:301

进入配置界面,依次设置:

  1. 服务器信息:名称、绑定地址和端口。
  2. WebSocket设置:默认端口和心跳时间。
  3. 代理设置:HTTP和HTTPS代理设置。
  4. 安全设置:加密算法、密钥和曲线。
  5. 压缩设置:启用zstd压缩。
  6. 访问控制:允许特定IP或启用认证。

步骤3:设置访问控制和认证(可选)

配置访问控制,允许特定IP或域名访问,或者启用认证。

步骤4:设置防火墙

确保服务器防火墙开放端口:

firewall-cmd --permanent --add-port=301/tcp
firewall-cmd --permanent --add-port=3011/tcp
firewall-cmd --permanent --add-port=8443/tcp
firewall-cmd --reload

步骤5:测试配置

使用 curl 测试:

curl -v http://localhost:8008
curl -v https://localhost:8443
curl -v ws://localhost:3011
curl -v wss://localhost:8443

步骤6:优化和监控

根据需要调整TRIE树大小和压缩算法,定期查看日志并清理。

完成

配置完成后,VLESS服务器已建立,可供浏览器或应用通过HTTP/HTTPS代理和WebSocket连接。

安装Docker

扫码添加XVPN网络加速器官网微信

扫码添加XVPN网络加速器官网微信

400-725-6318
扫码添加XVPN网络加速器官网微信

扫码添加XVPN网络加速器官网微信

网站地图