frp内网穿透stcp和xtcp配置

frp介绍

Github仓库:https://github.com/fatedier/frp

中文文档:简单、高效的内网穿透工具

stcp&xtcp客户端配置文件

注意

1
2
auth.token    # 在被访问端和访问端要一致
secretKey # 在被访问端和访问端要一致

被访问端配置

  • 编辑配置文件frpc.toml
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
# frps的地址和通信端口
# serverAddr设置自己的服务器公网IP
serverAddr = "1.1.1.1"
serverPort = 9999
# 与frps通信的认证方式和token值
auth.method = "token"
auth.token = "abcdefg1234567"

# 日志路径
log.to = "frpc.log"
# 日志级别
log.level = "info"
# 日志保存时间
log.maxDays = 3

# Windows远程访问
[[proxies]]
name = "teststcp"
type = "stcp"
localIP = "127.0.0.1"
localPort = 3389
secretKey = "1234567abcdef"

[[proxies]]
name = "testxtcp"
type = "xtcp"
localIP = "127.0.0.1"
localPort = 3389
secretKey = "1234567abcdef"

访问端配置

  • 编辑配置文件frpc.toml
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
# frps的地址和通信端口
# serverAddr设置自己的服务器公网IP
serverAddr = "1.1.1.1"
serverPort = 9999
# 与frps通信的认证方式和token值
auth.method = "token"
auth.token = "abcdefg1234567"

# 日志路径
log.to = "frpc.log"
# 日志级别
log.level = "info"
# 日志保存时间
log.maxDays = 3

# Windows远程访问
[[visitors]]
name = "stcp-visitor"
type = "stcp"
serverName = "teststcp"
secretKey = "1234567abcdef"
bindPort = -1

[[visitors]]
name = "xtcp-visitor"
type = "xtcp"
serverName = "testxtcp"
secretKey = "1234567abcdef"
bindAddr = "127.0.0.1"
bindPort = 41602
fallbackTo = "stcp-visitor"
fallbackTimeoutMs = 2000
keepTunnelOpen = true

远程时输入127.0.0.1:41602,即输入bindAddr:bindPort

stcp客户端配置文件

注意

1
2
auth.token    # 在被访问端和访问端要一致
secretKey # 在被访问端和访问端要一致

被访问端配置

  • 编辑配置文件frpc.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frps的地址和通信端口
# serverAddr设置自己的服务器公网IP
serverAddr = "1.1.1.1"
serverPort = 9999
# 与frps通信的认证方式和token值
auth.method = "token"
auth.token = "abcdefg1234567"

# 日志路径
log.to = "frpc.log"
# 日志级别
log.level = "info"
# 日志保存时间
log.maxDays = 3

# Windows远程访问
[[proxies]]
name = "teststcp"
type = "stcp"
localIP = "127.0.0.1"
localPort = 3389
secretKey = "1234567abcdef"

访问端配置

  • 编辑配置文件frpc.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frps的地址和通信端口
# serverAddr设置自己的服务器公网IP
serverAddr = "1.1.1.1"
serverPort = 9999
# 与frps通信的认证方式和token值
auth.method = "token"
auth.token = "abcdefg1234567"

# 日志路径
log.to = "frpc.log"
# 日志级别
log.level = "info"
# 日志保存时间
log.maxDays = 3

# Windows远程访问
[[visitors]]
name = "stcp-visitor"
type = "stcp"
serverName = "teststcp"
secretKey = "1234567abcdef"
bindAddr = "127.0.0.1"
bindPort = 41602

远程时输入127.0.0.1:41602,即输入bindAddr:bindPort

xtcp客户端配置文件

由于不一定能打洞成功,xtcp访问端和被访问端客户端配置文件参看官方文档。