haproxy 中转 / VPS 中转流量脚本

485次阅读
没有评论

共计 1089 个字符,预计需要花费 3 分钟才能阅读完成。

有的时候我们需要使用到一些特殊途径,但是因为国外某台 VPS 网络质量在连接本机的时候延迟很高,速度不快,这时候一台国内 VPS 刚好可以中转一下,就需要用到简单的中转流量脚本了。

haproxy 中转

遗憾的是 haproxy 只能中转你的 TCP 流量,并不能中转你的 UDP 流量,这也意味着如果你使用 haproxy 中转就不能够用你搭建的中转流量打游戏了。

第一步输入需要 haproxy 代理的端口号,这里要跟 Shadowsocks 服务器开放的端口号一致。
第二步输入 Shadowsocks 公网 IPv4(注意:不是 haproxy 本机的 IP 地址)

安装完成后,脚本提示如下:

  • Congratulations, haproxy install completed.
  • Your haproxy Server IP: your_haproxy_server_ip
  • Your haproxy Server port: your_haproxy_server_port
  • Your Input Shadowsocks IP: your_shadowsocks_server_ip
  • Welcome to visit:https://shadowsocks.be/10.html
  • Enjoy it.

卸载方法

使用 root 用户登录,Debian 或 Ubuntu 系统运行以下命令:

   apt-get -y remove haproxy

CentOS 系统运行如下命令:

   yum -y remove haproxy

然后再删除 haproxy 的配置文件目录即可,命令如下:

   rm -rf /etc/haproxy

使用命令

-   启动:service haproxy start

-   停止:service haproxy stop

-   重启:service haproxy restart

-   状态:service haproxy status

-   配置文件路径:/etc/haproxy/haproxy.cfg

Socat 转发一键脚本

wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/socat.sh && chmod +x socat.sh && bash socat.sh
正文完
 
alecctv
版权声明:本站原创文章,由 alecctv 2020-01-05发表,共计1089字。
转载说明:除特殊说明外本站文章皆由ooly.cc发布,转载请注明出处。
评论(没有评论)
验证码