服务器端

连接/设置 VPN

  1. # nohup ./Plex-Ubuntu-Qt-v6.0.2.AppImage& # 退出终端之后依然后台运行
  2. ./Plex-Ubuntu-Qt-v6.0.2.AppImage
  3. # 查看端口使用情况
  4. netstat -nlpt

在 Plex 里设置好 socks5 和 http、https 端口,选择绕过中国大陆模式(如果使用失败,尝试其他的模式)。
如果运行 vpn 之后依然无法连上外网,则考虑使用以下的额外代理工具。

安装/配置 proxychains-ng

  1. # 安装 proxychains-ng(github 上 proxychains 有两个分支)
  2. git clone https://github.com/rofl0r/proxychains-ng
  3. ./configure --prefix=/usr/local --sysconfdir=/etc # 设置安装路径和conf路径
  4. sudo make install-config
  5. sudo vim /etc/proxychains.conf

/etc/proxychains.conf 加入/修改以下内容:

  1. # 修改端口,支持 http socks5 socks4
  2. [ProxyList]
  3. http 127.0.0.1 41081
  4. socks5 127.0.0.1 1081

测试是否能使用

一般的命令行参数是不会使用代理的(也跟选择的 vpn 软件有关)

  1. curl http://httpbin.org/ip # 返回本地外网 ip
  2. #{
  3. # "origin": "129.28.186.100"
  4. #}

proxychains4 网络请求命令 可以切换到使用 vpn 网络访问:

  1. proxychains4 curl http://httpbin.org/ip # 返回代理 ip 或者 本地 ip(与VPN设置的模式有关)
  2. #[proxychains] config file found: /etc/proxychains.conf
  3. #[proxychains] preloading /usr/lib/libproxychains4.so
  4. #[proxychains] DLL init: proxychains-ng 4.14-git-39-g918855d
  5. #[proxychains] Dynamic chain ... 127.0.0.1:41081 ... 127.0.0.1:1081 ... 54.91.118.50:80 ... OK
  6. #{
  7. # "origin": "129.28.186.100"
  8. #}
  1. proxychains4 curl google.com # 代理成功则返回内容,不成功则显示失败或者卡住
  2. #[proxychains] config file found: /etc/proxychains.conf
  3. #[proxychains] preloading /usr/lib/libproxychains4.so
  4. #[proxychains] DLL init: proxychains-ng 4.14-git-39-g918855d
  5. #[proxychains] Dynamic chain ... 127.0.0.1:41081 ... 127.0.0.1:1081 ... 216.58.200.238:80 ... OK
  6. #<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
  7. #<TITLE>301 Moved</TITLE></HEAD><BODY>
  8. #<H1>301 Moved</H1>
  9. #The document has moved
  10. #<A HREF="http://www.google.com/">here</A>.
  11. #</BODY></HTML>

设备端

电脑浏览器(chrome)

使用 Proxy SwitchyOmega 插件,使用 http 或者 socks5 代理
image.png

手机

长按 wifi,修改网络,设置高级选项,填入服务器地址和代理端口即可。
例子:如何给华为手机网络连接设置代理