服务器端
连接/设置 VPN
# nohup ./Plex-Ubuntu-Qt-v6.0.2.AppImage& # 退出终端之后依然后台运行
./Plex-Ubuntu-Qt-v6.0.2.AppImage
# 查看端口使用情况
netstat -nlpt
在 Plex 里设置好 socks5 和 http、https 端口,选择绕过中国大陆模式(如果使用失败,尝试其他的模式)。
如果运行 vpn 之后依然无法连上外网,则考虑使用以下的额外代理工具。
安装/配置 proxychains-ng
# 安装 proxychains-ng(github 上 proxychains 有两个分支)
git clone https://github.com/rofl0r/proxychains-ng
./configure --prefix=/usr/local --sysconfdir=/etc # 设置安装路径和conf路径
sudo make install-config
sudo vim /etc/proxychains.conf
在 /etc/proxychains.conf
加入/修改以下内容:
# 修改端口,支持 http socks5 socks4
[ProxyList]
http 127.0.0.1 41081
socks5 127.0.0.1 1081
测试是否能使用
一般的命令行参数是不会使用代理的(也跟选择的 vpn 软件有关)
curl http://httpbin.org/ip # 返回本地外网 ip
#{
# "origin": "129.28.186.100"
#}
proxychains4 网络请求命令
可以切换到使用 vpn 网络访问:
proxychains4 curl http://httpbin.org/ip # 返回代理 ip 或者 本地 ip(与VPN设置的模式有关)
#[proxychains] config file found: /etc/proxychains.conf
#[proxychains] preloading /usr/lib/libproxychains4.so
#[proxychains] DLL init: proxychains-ng 4.14-git-39-g918855d
#[proxychains] Dynamic chain ... 127.0.0.1:41081 ... 127.0.0.1:1081 ... 54.91.118.50:80 ... OK
#{
# "origin": "129.28.186.100"
#}
proxychains4 curl google.com # 代理成功则返回内容,不成功则显示失败或者卡住
#[proxychains] config file found: /etc/proxychains.conf
#[proxychains] preloading /usr/lib/libproxychains4.so
#[proxychains] DLL init: proxychains-ng 4.14-git-39-g918855d
#[proxychains] Dynamic chain ... 127.0.0.1:41081 ... 127.0.0.1:1081 ... 216.58.200.238:80 ... OK
#<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
#<TITLE>301 Moved</TITLE></HEAD><BODY>
#<H1>301 Moved</H1>
#The document has moved
#<A HREF="http://www.google.com/">here</A>.
#</BODY></HTML>
设备端
电脑浏览器(chrome)
使用 Proxy SwitchyOmega 插件,使用 http 或者 socks5 代理
手机
长按 wifi,修改网络,设置高级选项,填入服务器地址和代理端口即可。
例子:如何给华为手机网络连接设置代理