最近很多脚本都更新支持Xray了,也有一些工具可以简单搭建,但是使用工具总会出现各种问题,今天给大家分享下使用Docker搭建teddysun大佬的脚本。
本文适合有一定Linux命令操作基础的用户,如果你完全看不懂,建议还是求助Q群:324748797 (联系管理员)
1、安装Docker
推荐在CentOS 7 x系统操作,Centos 8安装会稍微麻烦一点,今天暂时不说,可以参考此文后半部分《Centos 8安装Docker》的说明
安装docker 命令 ## ubuntu/debian 系统: curl -sSL https://get.docker.com/ | sh ## Centos 7 系统: wget -qO- get.docker.com | bash ## 腾讯云:curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
2、拉取Docker镜像
## xray镜像: docker pull teddysun/ ## SS-libev镜像 docker pull teddysun/shadowsocks-libev
3、创建配置文件
## Xray配置文件 mkdir -p /etc/xray ## SS-libev配置文件 mkdir -p /etc/shadowsocks-libev ## 可以使用cd /etc/xray ,然后vim config.json编辑
4、配置文件内容
Xray配置文件
端口和ID可以更改:
cat > /etc/xray/config.json <<EOF
{
"inbounds": [{
"port": 9000,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "1eb6e917-774b-4a84-aff6-b058577c60a5"
}
]
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {}
}]
}
EOF
SS 配置文件
cat > /etc/shadowsocks-libev/config.json <<EOF
{
"server":"0.0.0.0",
"server_port":9000,
"password":"password0",
"timeout":300,
"method":"aes-256-gcm",
"fast_open":true,
"nameserver":"8.8.8.8",
"mode":"tcp_and_udp"
}
EOF
SS-v2ray-plugin配置文件
cat > /etc/shadowsocks-libev/config.json <<EOF
{
"server":"0.0.0.0",
"server_port":9000,
"password":"password0",
"timeout":300,
"method":"aes-256-gcm",
"fast_open":true,
"nameserver":"8.8.8.8",
"mode":"tcp_and_udp",
"plugin":"v2ray-plugin",
"plugin_opts":"server"
}
EOF
SS-xray-plugin配置文件
cat > /etc/shadowsocks-libev/config.json <<EOF
{
"server":"0.0.0.0",
"server_port":9000,
"password":"password0",
"timeout":300,
"method":"aes-256-gcm",
"fast_open":true,
"nameserver":"8.8.8.8",
"mode":"tcp_and_udp",
"plugin":"xray-plugin",
"plugin_opts":"server"
}
EOF5、端口监听
TCP和UDP端口一样 ## Xray Run $ docker run -d -p 9000:9000 --name xray --restart=always -v /etc/xray:/etc/xray teddysun/xray ## SS Run $ docker run -d -p 9000:9000 -p 9000:9000/udp --name ss-libev --restart=always -v /etc/shadowsocks-libev:/etc/shadowsocks-libev teddysun/shadowsocks-libev
6、shadowsocks 插件下载
v2ray-plugin:https://github.com/shadowsocks/v2ray-plugin/releases xray-plugin:https://github.com/teddysun/xray-plugin/releases 使用说明: https://github.com/shadowsocks/v2ray-plugin#usage https://github.com/teddysun/xray-plugin#usage
未经允许不得转载:搬瓦工VPS_美国VPS » 国外VPS通过Docker搭建Xray、shadowsocks-libev带v2ray-plugin或Xray-plugin
搬瓦工VPS_美国VPS









