[[toc]]
- 服务端IP
- 服务端暴露32123
curl -o ptp https://raw.githubusercontent.com/wpjscc/ptp/main/bin/release-ptp-linux-v1.1.0 && chmod +x ptp
curl -o ptp https://raw.githubusercontent.com/wpjscc/ptp/main/bin/release-ptp-mac-v1.1.0 && chmod +x ptp
这个示例将本地的8080端口暴露出去
1 服务端配置 ptps.ini
[common]
tunnel_80_port = 32123tunnel_80_port客户端连接的端口http_port暴露的公网http端口,供用户访问
2 客户端配置 ptpc.ini
[common]
tunnel_host = x.x.x.x 或 www.domain.com
tunnel_80_port = 32123
[web]
local_host = 192.168.1.9
local_port = 8080
local_reaplce_host = true
domain = x.x.x.x:32123 或 www.domain.com:32123tunnel_host为公网服务器的ip或者指向公网服务器的域名tunnel_80_port上方的服务端监听的端口local_host暴露的内网的iplocal_port暴露的内网的端口local_reaplce_host替换host(http协议需要)domain用户访问的域名或ip
3 运行
服务端
./ptp -s客户端
./ptp -c4 验证
能正常访问 x.x.x.x:32123 说明部署没问题
php bin/build.php v1.1.0