Frp实现内网穿透
frp 是一个反向代理应用,客户端(frpc)主动连接公网服务器(frps)并建立持久连接,从而让外网用户通过 frps 访问位于内网的 frpc 机器上的服务。
通过sftp将本地文件上传到服务器
cd frp_0.62.1_linux_amd64
配置frps.ini
创建frps.ini文件
| [common] bind_port = 7000 dashboard_port = 7500 dashboard_user = admin dashboard_pwd = admin123 vhost_http_port = 8080 vhost_https_port = 8443
|
启动frps服务
Mac 安装frpc并部署
安装
配置frpc.ini
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| [common] server_addr = x.x.x.x # VPS 公网 IP server_port = 7000 # 与 frps 的 bind_port 对应 login_fail_exit = false # 重连VPS heartbeat_interval = 20 heartbeat_timeout = 90
[web] type = http local_port = 3000 # 本地 Web 服务端口(如 localhost:3000) custom_domains = yoursub.domain.com # 你用于访问的域名
[ssh] type = tcp local_port = 22 remote_port = 6000 # 你访问 ssh 的远程端口(可自定义)
|
如果报错.ini将被弃用,那么则将frpc.ini文件转为frpc.yml
启动frpc
开机自启