阿里云轻应用服务器搭建代理服务

水一篇😂😂😂

手动篇

安装

apt update
apt install python-apt python-pip git -y
pip install git+https://github.com/shadowsocks/shadowsocks.git@master

配置

cat /root/conf/proxy.json
{
    "server":"<ip>",
    "server_port":<port>,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"<passwd>",
    "timeout":300,
    "workers":4,
    "method":"salsa20",
    "fast_open": false
}

编译

wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar zxf LATEST.tar.gz
cd libsodium*
./configure
make && sudo make install

#将下面的代码追加到 `/etc/ld.so.conf`:
/lib
/usr/lib64
/usr/local/lib

# 重新载入配置:
ldconfig

启动

nohup sslocal -c /root/conf/proxy.json  2>&1 &

容器化部署(推荐)

操作前请先阅读操作此文档 阿里云轻量应用服务器升级内核

安装docker和docker-compose

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

下载proxy源码

apt install git
git clone https://github.com/ysicing/dockerfiles.git
cd dockerfiles/ss/v2/
# 编辑修改docker-compose.yml中PORT和PASS值
docker-compose up -d

阿里云防火墙配置

你使用了什么端口就放行什么端口

本地配置

服务器ip/端口 协议为salsa20

推荐阅读