我在远端有一台服务器,因为某些原因需要用这台服务器作为流量出口,当然可以通过搭建某些软件配置成V*N访问,但是那不是我想要的(因为远端的服务器配置太低了)。除了传统的ss类软件,我找到了3proxy这个小东西。
软件是支持Windows和linux的,我在本地搭建了个debian虚拟机,根据我的配置安装软件:
# wget https://github.com/3proxy/3proxy/releases/download/0.9.4/3proxy-0.9.4.x86_64.deb
# dpkg -i 3proxy-0.9.4.x86_64.deb
3proxy installed.
Failed to stop bin-systemctl.mount: Unit bin-systemctl.mount not loaded.
Failed to stop start.service: Unit start.service not loaded.
Failed to stop echo.service: Unit echo.service not loaded.
Failed to stop use.service: Unit use.service not loaded.
systemctl start 3proxy.service
to start proxy
systemctl stop 3proxy.service
to stop proxy
/usr/local/3proxy/conf/add3proxyuser.sh
to add users
Default config uses Google's DNS.
It's recommended to use provider supplied DNS or install local recursor, e.g. pdns-recursor.
Configure preferred DNS in /usr/local/3proxy/conf/3proxy.cfg.
run '/usr/local/3proxy/conf/add3proxyuser.sh admin password' to configure 'admin' user
Processing triggers for man-db (2.11.2-2) ...
然后去/etc/3proxy
下修改3proxy.conf
添加如下内容:
# 超时的时间值
timeouts 1 5 30 60 180 1800 15 60
# 内部IP地址,不可使用127.0.0.1,要具体地址,这里填你的电脑ip地址
internal 192.168.XX.XX
#无认证
auth none
flush
# 允许所有你配置的用户连接
allow *
# 这里手动指定端口1080
socks -p1080
然后执行命令重启服务:
systemctl restart 3proxy.service
最后在本地配置代理地址就行了。
比如我的虚拟机ip是192.168.50.50,那代理信息应该配置为:
IP:192.168.50.50
PORT:1080
USERNAME:
PASSWORD:
如果配置完执行systemctl status 3proxy
提示:
Dec 28 21:30:04 ProxyServer 3proxy[343005]: Failed to open pid file /var/run/3proxy/3proxy.pid
Dec 28 21:30:04 ProxyServer 3proxy[343005]: Command: 'pidfile' failed with code 1, line 3
则新建该文件
touch /var/run/3proxy/3proxy.pid
然后可能会提示:
ProxyServer 3proxy[2616]: /conf/passwd: No such file or directory
但是这个文件是实际存在的,在/etc/3proxy/conf/3proxy.conf
中被配置为:
users $/conf/passwd
直接把这里修改成:
users /etc/3proxy/conf/passwd
然后重启程序即可。
如果无法连接到该端口,建议看一下是否打开了防火墙并有放行端口。