[GH-ISSUE #4358] 请问0.59版本怎么配置一台服务器对应多客户端(无域名) #3441

Closed
opened 2026-05-05 14:12:57 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @weishengbin on GitHub (Jul 30, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4358

Describe the feature request

我只有一台服务器来做内网穿透,运营一个frps,然后我本地有2台电脑,如何实现本地的两台电脑使用同一台服务器一起实现内网穿透呢?最新版本(0.59)

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @weishengbin on GitHub (Jul 30, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/4358 ### Describe the feature request 我只有一台服务器来做内网穿透,运营一个frps,然后我本地有2台电脑,如何实现本地的两台电脑使用同一台服务器一起实现内网穿透呢?最新版本(0.59) ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@dalaosec commented on GitHub (Jul 30, 2024):

每台机器部署一个frpc 就行了

<!-- gh-comment-id:2257885535 --> @dalaosec commented on GitHub (Jul 30, 2024): 每台机器部署一个frpc 就行了
Author
Owner

@weishengbin commented on GitHub (Jul 30, 2024):

每台机器部署一个frpc 就行了

问题是服务端的配置vhostHTTPPort字段只能设置一个端口(我主要用来做http协议的内网穿透),搭建好之后访问方式是http://服务器ip:vhostHTTPPort,无法区分到达哪台本地机器,以下为我的服务端配置文件

`
bindPort = 7000 #{必选} 客户端与该端口建立连接
vhostHTTPPort = 8545
log.to = "console" #{可选} 日志配置, 通过打印的方式输出日志

#身份验证
auth.method = "token" #{可选}身份验证方式
auth.token = "123456" #token设置密码,用于通过身份验证创建连接

#frp服务仪表板配置
webServer.port = 7077 #{自行修改端口}
webServer.addr = "0.0.0.0" #公网ip或者0.0.0.0或者域名
webServer.user = "admin" #登录用户名{自行修改}
webServer.password = "admin" #登录密码{自行修改}
webServer.pprofEnable = false
transport.maxPoolCount = 50
transport.heartbeatTimeout = 90
transport.tcpMux = true
transport.tcpMuxKeepaliveInterval = 60
transport.tcpKeepalive = 120
`

<!-- gh-comment-id:2258067225 --> @weishengbin commented on GitHub (Jul 30, 2024): > 每台机器部署一个frpc 就行了 问题是服务端的配置vhostHTTPPort字段只能设置一个端口(我主要用来做http协议的内网穿透),搭建好之后访问方式是http://服务器ip:vhostHTTPPort,无法区分到达哪台本地机器,以下为我的服务端配置文件 ` bindPort = 7000 #{必选} 客户端与该端口建立连接 vhostHTTPPort = 8545 log.to = "console" #{可选} 日志配置, 通过打印的方式输出日志 #身份验证 auth.method = "token" #{可选}身份验证方式 auth.token = "123456" #token设置密码,用于通过身份验证创建连接 #frp服务仪表板配置 webServer.port = 7077 #{自行修改端口} webServer.addr = "0.0.0.0" #公网ip或者0.0.0.0或者域名 webServer.user = "admin" #登录用户名{自行修改} webServer.password = "admin" #登录密码{自行修改} webServer.pprofEnable = false transport.maxPoolCount = 50 transport.heartbeatTimeout = 90 transport.tcpMux = true transport.tcpMuxKeepaliveInterval = 60 transport.tcpKeepalive = 120 `
Author
Owner

@miws commented on GitHub (Jul 30, 2024):

每台frpc指定不同的remotePort, 可以不是vhostHTTPort

<!-- gh-comment-id:2258596313 --> @miws commented on GitHub (Jul 30, 2024): 每台frpc指定不同的remotePort, 可以不是vhostHTTPort
Author
Owner

@weishengbin commented on GitHub (Jul 30, 2024):

每台frpc指定不同的remotePort, 可以不是vhostHTTPort

请问有配置示例吗,最新版本0.59的,感谢

<!-- gh-comment-id:2258702741 --> @weishengbin commented on GitHub (Jul 30, 2024): > 每台frpc指定不同的remotePort, 可以不是vhostHTTPort 请问有配置示例吗,最新版本0.59的,感谢
Author
Owner

@miws commented on GitHub (Jul 31, 2024):

每台frpc指定不同的remotePort, 可以不是vhostHTTPort

请问有配置示例吗,最新版本0.59的,感谢

proxies
name = "plugin_http2http"
type = "tcp"
remotePort = 6007
[proxies.plugin]
type = "http2http"
localAddr = "127.0.0.1:80"
hostHeaderRewrite = "127.0.0.1"
requestHeaders.set.x-from-where = "frp"

更多用法你参照 frpc_full_example.toml使用

<!-- gh-comment-id:2259442348 --> @miws commented on GitHub (Jul 31, 2024): > > 每台frpc指定不同的remotePort, 可以不是vhostHTTPort > > 请问有配置示例吗,最新版本0.59的,感谢 [[proxies]] name = "plugin_http2http" type = "tcp" remotePort = 6007 [proxies.plugin] type = "http2http" localAddr = "127.0.0.1:80" hostHeaderRewrite = "127.0.0.1" requestHeaders.set.x-from-where = "frp" 更多用法你参照 frpc_full_example.toml使用
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#3441
No description provided.