[GH-ISSUE #934] tcp 端口 同一端口 #743

Closed
opened 2026-05-05 12:28:34 -06:00 by gitea-mirror · 10 comments
Owner

Originally created by @darkrain88 on GitHub (Sep 26, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/934

frpc.ini [range:test_tcp] type = tcp local_ip = 127.0.0.1 local_port = 6000-6006,6007 remote_port = 6000-6006,6007

我服务器 客户端都在一个路由上面。能打开同一个端口吗?

我用v6地址访问路由,

内网服务不支持v6

我访问v6:9091 想转发到 127.0.0.1:9091
是否可以。

配置不通过端口被暂用。

Originally created by @darkrain88 on GitHub (Sep 26, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/934 frpc.ini [range:test_tcp] type = tcp local_ip = 127.0.0.1 local_port = 6000-6006,6007 remote_port = 6000-6006,6007 我服务器 客户端都在一个路由上面。能打开同一个端口吗? 我用v6地址访问路由, 内网服务不支持v6 我访问v6:9091 想转发到 127.0.0.1:9091 是否可以。 配置不通过端口被暂用。
Author
Owner

@shellus commented on GitHub (Oct 9, 2018):

local_port 和 remote_port可以是同一端口。
但是都在一个机器上的情况下,你的frps需要监听你指定的remote_port。
然后你的服务端口在local_port。
端口肯定是冲突了的,frp是无法解决这种问题的。

但是你可以讲一下你的内网服务是什么,也许我们可以提供一个另外的解决思路。

<!-- gh-comment-id:428048501 --> @shellus commented on GitHub (Oct 9, 2018): local_port 和 remote_port可以是同一端口。 但是都在一个机器上的情况下,你的frps需要监听你指定的remote_port。 然后你的服务端口在local_port。 端口肯定是冲突了的,frp是无法解决这种问题的。 但是你可以讲一下你的内网服务是什么,也许我们可以提供一个另外的解决思路。
Author
Owner

@darkrain88 commented on GitHub (Oct 9, 2018):

@shellus 谢谢 不需要了

<!-- gh-comment-id:428062826 --> @darkrain88 commented on GitHub (Oct 9, 2018): @shellus 谢谢 不需要了
Author
Owner

@kenhenry commented on GitHub (Oct 12, 2018):

@shellus 请问一下,我的公网服务器只开放80端口。在不影响公网上web服务的情况下,能不能通过80端口连接到内网的远程桌面3389?我看了文档说明,有端口复用的功能,但具体不清楚需要怎样配置。

<!-- gh-comment-id:429298119 --> @kenhenry commented on GitHub (Oct 12, 2018): @shellus 请问一下,我的公网服务器只开放80端口。在不影响公网上web服务的情况下,能不能通过80端口连接到内网的远程桌面3389?我看了文档说明,有端口复用的功能,但具体不清楚需要怎样配置。
Author
Owner

@darkrain88 commented on GitHub (Oct 13, 2018):

这个不简单用 域名二级

kenh notifications@github.com 于 2018年10月12日周五 下午7:44写道:

@shellus https://github.com/shellus
请问一下,我的公网服务器只开放80端口。在不影响公网上web服务的情况下,能不能通过80端口连接到内网的远程桌面3389?我看了文档说明,有端口复用的功能,但具体不清楚需要怎样配置。


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/fatedier/frp/issues/934#issuecomment-429298119, or mute
the thread
https://github.com/notifications/unsubscribe-auth/Al8Wv-XuM2K2ZLxbvEUt9k7sdGLdk--wks5ukICMgaJpZM4W6uOv
.

<!-- gh-comment-id:429537325 --> @darkrain88 commented on GitHub (Oct 13, 2018): 这个不简单用 域名二级 kenh <notifications@github.com> 于 2018年10月12日周五 下午7:44写道: > @shellus <https://github.com/shellus> > 请问一下,我的公网服务器只开放80端口。在不影响公网上web服务的情况下,能不能通过80端口连接到内网的远程桌面3389?我看了文档说明,有端口复用的功能,但具体不清楚需要怎样配置。 > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/fatedier/frp/issues/934#issuecomment-429298119>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/Al8Wv-XuM2K2ZLxbvEUt9k7sdGLdk--wks5ukICMgaJpZM4W6uOv> > . >
Author
Owner

@shellus commented on GitHub (Oct 13, 2018):

@dark 这无法简单的实现,因为一个端口很难同时提供两种服务,这需要一个前置代理,来识别不同协议的请求并随后转发到不同的服务,haproxy可以做到这一点,但是配置起来并不容易

<!-- gh-comment-id:429542700 --> @shellus commented on GitHub (Oct 13, 2018): @dark 这无法简单的实现,因为一个端口很难同时提供两种服务,这需要一个前置代理,来识别不同协议的请求并随后转发到不同的服务,haproxy可以做到这一点,但是配置起来并不容易
Author
Owner

@darkrain88 commented on GitHub (Oct 14, 2018):

@dark 这无法简单的实现,因为一个端口很难同时提供两种服务,这需要一个前置代理,来识别不同协议的请求并随后转发到不同的服务,haproxy可以做到这一点,但是配置起来并不容易

frp 设置 多看看。 vhost http https 端口都是一个。 tcp 可以指定

<!-- gh-comment-id:429594919 --> @darkrain88 commented on GitHub (Oct 14, 2018): > @dark 这无法简单的实现,因为一个端口很难同时提供两种服务,这需要一个前置代理,来识别不同协议的请求并随后转发到不同的服务,haproxy可以做到这一点,但是配置起来并不容易 frp 设置 多看看。 vhost http https 端口都是一个。 tcp 可以指定
Author
Owner

@shellus commented on GitHub (Oct 14, 2018):

@dark frp支持http和https共用端口,是因为frp在内部识别了这些协议。但是rdp协议frp是不会支持和识别的。

<!-- gh-comment-id:429596029 --> @shellus commented on GitHub (Oct 14, 2018): @dark frp支持http和https共用端口,是因为frp在内部识别了这些协议。但是rdp协议frp是不会支持和识别的。
Author
Owner

@kenhenry commented on GitHub (Oct 15, 2018):

@shellus 是的,后来用haproxy可以实现,但是发现公司里的80端口对于ssh协议的数据都无法通过,这就有点坑了。我的腾讯云就可以。

<!-- gh-comment-id:429729073 --> @kenhenry commented on GitHub (Oct 15, 2018): @shellus 是的,后来用haproxy可以实现,但是发现公司里的80端口对于ssh协议的数据都无法通过,这就有点坑了。我的腾讯云就可以。
Author
Owner

@shellus commented on GitHub (Oct 19, 2018):

@kenh 说明你公司的防火墙不仅仅是限制80端口,还限定了http协议。

<!-- gh-comment-id:431286651 --> @shellus commented on GitHub (Oct 19, 2018): @kenh 说明你公司的防火墙不仅仅是限制80端口,还限定了http协议。
Author
Owner

@yanickxia commented on GitHub (Mar 16, 2021):

@shellus 是的,后来用haproxy可以实现,但是发现公司里的80端口对于ssh协议的数据都无法通过,这就有点坑了。我的腾讯云就可以。

Haproxy 有参考么,求个文档

<!-- gh-comment-id:799932565 --> @yanickxia commented on GitHub (Mar 16, 2021): > @shellus 是的,后来用haproxy可以实现,但是发现公司里的80端口对于ssh协议的数据都无法通过,这就有点坑了。我的腾讯云就可以。 Haproxy 有参考么,求个文档
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#743
No description provided.