frp常用配置

12/31/2024 网络内网穿透

目录


参考:


# frp常用配置

# 版本:frp-0.58.1 (opens new window)

文档:https://gofrp.org/zh-cn/

# frps.toml

### ==================== 通信配置 
# 绑定地址
bindAddr = "0.0.0.0"
# 绑定端口
bindPort = 7000
# KCP绑定端口
kcpBindPort = 7000
# QUIC绑定端口
quicBindPort = 7000
# HTTP代理端口
vhostHTTPPort = 80
# HTTPS代理端口
vhostHTTPSPort = 443
# 启用心跳配置(超时90s)
transport.heartbeatTimeout = 90
# 启用TCP多路复用
transport.tcpMux = true
# 启用连接池(每个代理可以创建的连接池上限)
transport.maxPoolCount = 5
# 启用TLS协议加密(不配置证书,进加密不校验证书)
transport.tls.force = true

### ==================== 认证配置
# 认证方式:token
auth.method = "token"
# 认证参数:token的值
auth.token = "1234567890987654321"

### ==================== 看板配置
# 看板地址
webServer.addr = "0.0.0.0"
# 看板端口
webServer.port = 7500
# 看板用户
webServer.user = "admin"
# 看板密码
webServer.password = "an@at3721"
# 看板启用性能分析
webServer.pprofEnable = true
# 看板启用/metrics的API导出Prometheus的监控数据
enablePrometheus = true

### ==================== 日志配置
# 日志文件
log.to = "./frps.log"
# 日志等级
log.level = "info"
# 日志天数
log.maxDays = 3
# 日志打印颜色启用
log.disablePrintColor = false
# 日志将特定错误(带有调试信息)发送到客户端
detailedErrorsToClient = true
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

# frpc.toml

### ==================== 通信配置 
# 绑定地址
serverAddr = "124.223.32.22"
# 绑定端口
serverPort = 7000
# 首次连接失败继续连接
loginFailExit = false
# 启用心跳配置(超时90s)
transport.heartbeatTimeout = 90
# 启用TCP多路复用
transport.tcpMux = true
# 启用连接池(每个代理预创建连接的数量)
transport.poolCount = 5
# 启用TLS协议加密(不配置证书,进加密不校验证书)
transport.tls.enable = true

### ==================== 认证配置
# 认证方式:token
auth.method = "token"
# 认证参数:token的值
auth.token = "1234567890987654321"

### ==================== 看板配置
# 看板地址
webServer.addr = "127.0.0.1"
# 看板端口
webServer.port = 7400
# 看板用户
webServer.user = "admin"
# 看板密码
webServer.password = "an@at3721"
# 看板启用性能分析
webServer.pprofEnable = true

### ==================== 日志配置
# 日志文件
log.to = "./frpc.log"
# 日志等级
log.level = "info"
# 日志天数
log.maxDays = 3
# 日志打印颜色启用
log.disablePrintColor = false

### ==================== 代理配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

ssh

#ssh
[[proxies]]
# 代理名称
name = "ssh"
# 代理协议类型
type = "tcp"
# 本地地址
localIP = "127.0.0.1"
localPort = 22
# 代理端口
remotePort = 2201
1
2
3
4
5
6
7
8
9
10
11

web-http

#web-http
[[proxies]]
# 代理名称
name = "web01"
# 代理协议类型
type = "http"
# 本地地址
localIP = "127.0.0.1"
localPort = 80
# 安全访问账户/密码
httpUser = "admin"
httpPassword = "admin"
# 子域名
# subdomain = "web01"
# 自定义域名
customDomains = ["web01.yourdomain.com"]
# 路由(only available for http type)
locations = ["/", "/pic"]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

web-https

#web-https
[[proxies]]
# 代理名称
name = "web02"
# 代理协议类型
type = "https"
# 本地地址
localIP = "127.0.0.1"
localPort = 8000
# 安全访问账户/密码
httpUser = "admin"
httpPassword = "admin"
# 子域名
subdomain = "web02"
# 自定义域名
customDomains = ["web02.yourdomain.com"]
# 代理协议版本
transport.proxyProtocolVersion = "v2"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[[proxies]]
name = "test-tcp"
type = "http"
localIP = "127.0.0.1"
localPort = 8888
customDomains = ["124.223.32.22"]

1
2
3
4
5
6
7
上次更新时间: 9/25/2024, 9:19:15 AM