[GH-ISSUE #3927] [Feature Request] 请问tcp转发时能否获取到真实的公网ip? #3117

Closed
opened 2026-05-05 14:01:04 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @seepine on GitHub (Jan 12, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/3927

Describe the feature request

我内网有服务器A,需要客户电脑B的tcpClient去连A的tcpServer,我通过云服务器G搭建frps,A搭建frpc,转发tcp端口5000,然后B通过公网ip+5000端口连接,能够成功连到A了,但是A识别到的ip是127.0.0.1,毕竟在A的tcpServer看来,是本机frpc发起的连接,而我需要让A的tcpServer识别出是公网ip连接过来的,请问frp目前可以实现吗或以后是否会实现,或者有没有其他方案可以解决

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 @seepine on GitHub (Jan 12, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/3927 ### Describe the feature request 我内网有服务器A,需要客户电脑B的tcpClient去连A的tcpServer,我通过云服务器G搭建frps,A搭建frpc,转发tcp端口5000,然后B通过公网ip+5000端口连接,能够成功连到A了,但是A识别到的ip是127.0.0.1,毕竟在A的tcpServer看来,是本机frpc发起的连接,而我需要让A的tcpServer识别出是公网ip连接过来的,请问frp目前可以实现吗或以后是否会实现,或者有没有其他方案可以解决 ### 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
gitea-mirror 2026-05-05 14:01:04 -06:00
Author
Owner

@xqzr commented on GitHub (Jan 12, 2024):

tcpServer 自行实现 Proxy Protocol 与 frpc 对接
https://gofrp.org/zh-cn/docs/features/common/realip/#proxy-protocol

<!-- gh-comment-id:1888726226 --> @xqzr commented on GitHub (Jan 12, 2024): tcpServer 自行实现 `Proxy Protocol` 与 frpc 对接 https://gofrp.org/zh-cn/docs/features/common/realip/#proxy-protocol
Author
Owner

@wuai1024 commented on GitHub (Jan 18, 2024):

Describe the feature request

我内网有服务器A,需要客户电脑B的tcpClient去连A的tcpServer,我通过云服务器G搭建frps,A搭建frpc,转发tcp端口5000,然后B通过公网ip+5000端口连接,能够成功连到A了,但是A识别到的ip是127.0.0.1,毕竟在A的tcpServer看来,是本机frpc发起的连接,而我需要让A的tcpServer识别出是公网ip连接过来的,请问frp目前可以实现吗或以后是否会实现,或者有没有其他方案可以解决

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

你这个端口看起来是群晖的吧,需要先用nginx接受转发,然后在DSM上再设置下。

<!-- gh-comment-id:1898526017 --> @wuai1024 commented on GitHub (Jan 18, 2024): > ### Describe the feature request > 我内网有服务器A,需要客户电脑B的tcpClient去连A的tcpServer,我通过云服务器G搭建frps,A搭建frpc,转发tcp端口5000,然后B通过公网ip+5000端口连接,能够成功连到A了,但是A识别到的ip是127.0.0.1,毕竟在A的tcpServer看来,是本机frpc发起的连接,而我需要让A的tcpServer识别出是公网ip连接过来的,请问frp目前可以实现吗或以后是否会实现,或者有没有其他方案可以解决 > > ### 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 你这个端口看起来是群晖的吧,需要先用nginx接受转发,然后在DSM上再设置下。
Author
Owner

@github-actions[bot] commented on GitHub (Feb 9, 2024):

Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1935146338 --> @github-actions[bot] commented on GitHub (Feb 9, 2024): Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
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#3117
No description provided.