frp

时间:2020-02-01 10:51:14   收藏:0   阅读:96
适用情况:有一台拥有公网ip的计算机
frp架构图:

技术图片

frp下载地址:https://github.com/fatedier/frp/releases
配置过程:
[common]
bind_port = 7000 #服务端和客户端进行通信的端口
vhost_http_port = 10080 #可以访问到内网web服务的端口

配置好后,启动服务:

nohup ./frps -c frps.ini &  #该命令适用于Linux,表示在后台运行frp服务
[common]
server_addr = 1.2.3.4         #公网服务器ip
server_port = 7000            #与服务端bind_port一致,服务端和客户端通信端口
 
#公网通过ssh访问内部服务器
[ssh]
type = tcp              #连接协议
local_ip = 127.0.0.1    #内网服务器ip
local_port = 22         #内网ssh端口号
remote_port = 6000      #通过外网访问ssh的端口
 
#公网访问内部web服务器以http方式
[web]
type = http         #访问协议
local_port = 8081   #内网web服务的端口号
custom_domains = www.xxx.com   #所绑定的公网服务器域名,一级、二级域名都可以

配置好后,启动服务:

nohup ./frpc -c frpc.ini &    #该命令适用于Linux,表示在后台运行frp服务
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!