如果说HTTP是单工通讯的话,WebSocket则是HTML5开始提供的一种在单个TCP连接上进行全双工通讯的协议,由此便产生了新的代理形式。
Github:
https://github.com/lzjluzijie/websocks
安装Websocks:
wget https://github.com/lzjluzijie/websocks/releases/download/v0.5.0/websocks_Linux_x86_64.tar.gz
tar -xzvf websocks_Linux_x86_64.tar.gz
chmod +x websocks
安装Caddy:
Websocks采用TLS加密,用户也可以使用Caddy实现TLS,若采用后者,则需要安装Caddy,可自动申请Let’s Encrypt的TLS证书。
wget https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/caddy_install.sh
chmod +x caddy_install.sh
./caddy_install.sh
Caddy配置文件Caddyfile(/usr/local/caddy/Caddyfile):
https://域名 {
proxy /密码 localhost:监听端口 {
websocket
}
}
启动/停止/重启Caddy:
service caddy start/stop/restart
或
systemctl start/stop/restart caddy
Caddy自动申请SSL证书位置:
/.caddy/acme/acme-v01.api.letsencrypt.org/sites/xxx.xxx(域名)/
卸载 Caddy:
./caddy_install.sh uninstall
Systemd配置:
vi /etc/systemd/system/websocks.service
内容:
[Unit]
Description=websocks
[Service]
ExecStart=/root/websocks server -l 127.0.0.1:监听端口 -p /密码
(若使用内置TLS,应为:ExecStart=/root/websocks server -l 127.0.0.1:监听端口 -p /密码 https://www.debian.org/ --tls)
Restart=always
[Install]
WantedBy=multi-user.target
运行/停止/重启Websocks:
service websocks start/stop/restart
或
systemctl start/stop/restart websocks.service
设为自启动:
systemctl enable websocks.service
客户端配置:
内置 TLS:
./websocks client -l :1080 -s wss://the-real-server.com:2333/密码 -n www.debian.org --insecure
Caddy TLS:
./websocks client -l :1080 -s wss://server.com/密码
使用mysqldump命令备份数据库时,出现错误:
"mysqldump: Got error: 145: Table './myhost/silo_redirection_404' is marked as crashed and should be repaired when using LOCK TABLES"。
分析:
数据表被占用。
解决:
用phpmyadmin检查"silo_redirection_404"状态,如在使用中,运行修复表改状态。
遇到登录FTP时出现错误:
"421 Too many connections (12) from this IP"
解决办法:
服务器端:修改MaxClientPerIP参数,加大时间。
客户端:修改响应时间超时,大于服务器MaxClientPerIP参数时间。
一键脚本安装脚本:
系统:centos7+/debian9+/ubuntu16.04+
网站:www.v2rayssr.com
curl -O https://raw.githubusercontent.com/V2RaySSR/Trojan/master/Trojan.sh && chmod x trojan.sh && ./trojan.sh
or:
wget --no-check-certificate https://raw.githubusercontent.com/V2RaySSR/Trojan/master/Trojan.sh && chmod +x Trojan.sh && ./Trojan.sh
编辑配置:
/usr/src/trojan/server.conf
Github 项目地址:
https://github.com/atrandys/trojan
安装 curl:
apt-get update -y && apt-get install curl -y ##Ubuntu/Debian 系统安装 Curl 方法
yum update -y && yum install curl -y ##Centos 系统安装 Curl 方法
安装 XZ 压缩工具:
apt-get install xz-utils #Debian/Ubuntu 安装 XZ 压缩工具命令
yum install xz #CentOS 安装 XZ 压缩工具
客户端:
https://github.com/trojan-gfw/trojan/releases
iPhone上使用小火箭扫码:
单独安装bbr:
cd /usr/src && wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh