Proxyer
Proxyer是一个网络代理工具,它可以将本地计算机的网络流量(如HTTP、HTTPS、TCP等)转发到远程服务器。使用Proxyer可以在本地计算机上建立一个代理服务器,通过代理服务器来访问互联网上的资源。
yum仓库设置
rm -f /etc/yum.repos.d/*.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum repolist
安装Docker
yum -y install docker-ce
systemctl start docker
systemctl enable docker
安装Docker Compose
curl -L https://github.com/docker/compose/releases/download/1.26.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
写入Docker Compose文件
version: "3.7"
services:
install:
image: registry.cn-hangzhou.aliyuncs.com/proxyers/proxyers:v1.0.1
command: /bin/sh /opt/bin/install.sh "${PROXYER_PUBLIC_HOST}:6789"
volumes:
- /mnt/data/proxyer:/opt/proxyer
restart: "no"
proxyer-server:
image: registry.cn-hangzhou.aliyuncs.com/proxyers/proxyers:v1.0.1
command: /opt/bin/pdns -bind="0.0.0.0:6789" -etcd="127.0.0.1:2379" -pip="${PROXYER_PUBLIC_HOST}"
network_mode: host
extra_hosts:
- "${PROXYER_PUBLIC_HOST}:127.0.0.1"
volumes:
- /mnt/data/proxyer:/opt/proxyer
depends_on:
- etcd
restart: on-failure
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
proxyer-turn:
image: registry.cn-hangzhou.aliyuncs.com/proxyers/proxyers:v1.0.1
command: /opt/bin/stp -sign="0.0.0.0:6544" -pip="${PROXYER_PUBLIC_HOST}" -etcd="127.0.0.1:2379" -pdns="127.0.0.1:6789"
network_mode: host
depends_on:
- etcd
restart: on-failure
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
etcd:
image: registry.cn-hangzhou.aliyuncs.com/proxyers/etcds:v3.0
command: /usr/local/bin/etcd --name proxyer-etcd --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster proxyer-etcd=http://0.0.0.0:2380 --initial-cluster-token proxyer
ports:
- "2379:2379"
volumes:
- /mnt/data/proxyer/etcd:/etcd-data
restart: on-failure
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
安装Proxye
#请将xxxx.xxxx.xxxx.xxxx改成你的服务器ip地址后再运行
export PROXYER_PUBLIC_HOST=xxxx.xxxx.xxxx.xxxx
docker-compose up -d
开放端口
firewall-cmd --zone=public --add-port=6789/tcp --permanent #开放6789端口
firewall-cmd --zone=public --add-port=6789/tcp --permanent #开放6544端口
firewall-cmd --reload # 配置立即生效
Proxyer使用
访问ip:6789
下载客户端
解压压缩包,运行exe文件,直接进入客户端页面
创建映射(注意要开放本地和云服务器对应映射的端口)
启动服务
写test接口
访问接口
可以在服务页面查看映射