介绍
故事发生在两周前,也就是暑假结尾,我的Minecraft服务器要搬到新的服务器上,可我万万没想到那个主机它封国外IP(我直接崩溃),我折腾了一天半,最后还是以失败告终,我甚至试过java -Dhttp.proxyHost=http://127.0.0.1 -Dhttp.proxyPort=8118 -Dhttps.proxyHost=http://127.0.0.1 -Dhttps.proxyPort=8118 -Xmx6G -jar Paper-1.16.1-b136.jar nogui
但是,没用!最后AliceStyle群里的大佬推荐试试Proxychains,果然可以!
Proxychain的使用方法简单得离谱,只需
proxychains4 <要代理的程序>
安装
不论CentOS还是Ubuntu,推荐从源码安装,很快的。
在此之前,请先安装git和gcc :
For CentOS/RHEL: yum install git gcc -y
For Ubuntu/Debian: apt install git gcc -y
从Gayhub上获取最新的Release源码:https://github.com/rofl0r/proxychains-ng/releases
目前最新版是4.14
wget https://github.com/rofl0r/proxychains-ng/archive/v4.14.zip
unzip v4.14.zip &&cd proxychains-ng-4.14
编译安装
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install
sudo make install-config
修改配置文件
vim /etc/proxychains.conf
在配置文件最后,添加/修改代理服务器设置,例如本地http 9119端口代理
http 127.0.0.1 9119
保存,安装完成!
试试代理服务器是否有效
proxychains4 curl myip.ipip.net
吐槽一句,禁封国外IP的主机就是废物,开Minecraft不行,还得这样挂代理,BitTorrent下载也下不了(Tracker全是国外的)