docker部署ws+tls

实用教程 admin 2年前 (2022-02-19) 1463次浏览 1个评论

介绍

昨天介绍了使用docker部署xtls,今天我们来看看使用docker部署ws+tls,这里我们采用秋水大佬的docker镜像。

image.png

前提

1. 对*ray的配置文件有基本的了解。

2. 域名已经做好解析。

3. 已经申请好证书并存储于vps。

安装docker

wget -qO- get.docker.com | bash

准备*ray配置文件

创建*ray目录

mkdir /root/xray

请确保下文的证书密钥,chain.crt和key.key,已经位于此目录。

创建config.json配置文件

vi /root/xray/config.json,或者直接上传现成的config.json文件也可以。其中id和path请自己自定义。

{
  "inbounds": [
    {
      "port": 443,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "72863012-8b19-11ec-aaaa-00163e2300cc"
          }
        ],
        "decryption": "none"
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "tlsSettings": {
          "certificates": [
            {
              "certificateFile": "/etc/xray/chain.crt",
              "keyFile": "/etc/xray/key.key"
            }
          ],
          "alpn": [
            "http/1.1"
          ]
        },
        "tcpSettings": {},
        "kcpSettings": {},
        "httpSettings": {},
        "wsSettings": {
          "path": "/bueEnIYC/",
          "headers": {
            "Host": ""
          }
        },
        "quicSettings": {}
      },
      "domain": ""
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

拉取镜像并启动容器

host模式

docker run -d --network host --name xray --restart=always -v /root/xray:/etc/xray teddysun/xray

bridge模式

docker run -d -p 443:443 --name xray --restart=always -v /root/xray:/etc/xray teddysun/xray

 


VPS小白 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:docker部署ws+tls
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(1)个小伙伴在吐槽