Frpc 的简单设置(自用)

  • 之所以选择frp,是因为:更新了新功能,越来越完善;Ngrok又需要编译啥的,比较繁琐。
  • 官方的配置文档很清楚了,最近更新了tcp和kcp等新功能,请尽量参考官方文档!

项目地址:https://github.com/fatedier/frp
项目配置说明:https://github.com/fatedier/frp/blob/master/README_zh.md

  • [服务端] frps.ini 配置:
[common]
bind_port = 7000
#vhost_http_port               网站访问端口
vhost_http_port = 80
#vhost_https_port = 443
#dashboard_port               状态以及代理统计信息展示,网址:7500可查看详情
dashboard_port = 7500
log_file = ./frps.log
log_level = info
log_max_days = 3
#privilege_mode               特权模式,开通后web,ssh等使用都可以直接在客户端设置
privilege_mode = true
#特权连接密码
privilege_token = 12345678    这里的密码大家改复杂点
#max_pool_count               最大链接池,每个代理预先与后端服务器建立起指定数量的最大链接数
max_pool_count = 50

```


- [客户端] frpc.ini 配置

```
[common]
#server_addr服务器ip
server_addr = xxx.xxx.xxx.xxx
server_port = 7000
log_file = ./frpc.log
log_level = info
log_max_days = 3
#特权连接密码
privilege_token = 12345678

[Web]
#privilege_mode特权模式
privilege_mode = true
type = http
local_ip = 127.0.0.1
local_port = 80
#custom_domains域名
custom_domains = youname.com,www.youname.com
pool_count = 10



[ssh]
privilege_mode = true
type = tcp
#remote_port外部端口
remote_port = 10086
local_ip = 127.0.0.1
#local_port内部端口
local_port = 22
use_gzip = true
use_encryption = true
pool_count = 2

```

- 让客服端与服务端常驻后台

```
#开启另一个子终端 任务名字 frp
root@hxyisme:~#screen -S frp
#分别运行 frp 服务端和客服端程序
root@hxyisme#./frpc -c ./frpc.ini

#如果需要关闭 frp
screen -S frp  后
ctrl+c  即可



```


- 查看连接情况

打开 youname.com:7500 就可以看见了。。。


![连接情况](http://upload-images.jianshu.io/upload_images/2125118-39178d49dbeecf7b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值