MENU

#脚本#VPS中转流量脚本

July 26, 2019 • Read: 1786 • 网络笔记

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

haproxy中转

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

  • 本脚本适用环境
  • 系统支持:CentOS,Debian,Ubuntu
  • 内存要求:≥128M

    wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/haproxy.sh
    chmod +x haproxy.sh
    ./haproxy.sh

    第一步输入需要 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

安装完成输入./socat.sh 使用

Last Modified: July 30, 2019
Archives QR Code Tip
QR Code for this page
Tipping QR Code