mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #3109] [Feature Request] FRPC建立的反代连接里面,可以指定端口 #2491
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#2491
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Wai5888 on GitHub (Sep 27, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3109
Describe the feature request
我的组网:
my_server---frpc---frps---dst_server
我的server需要明确对端的端口,并在一直的地址、端口信息下进行通信。
现有的情况:
dst_server通过frps的代理端口可以将数据转发给frpc,frpc可以再发送数据到my_server,但是my_server校验它的端口并非协商的端口,导致无法响应。
希望frpc的配置能增加一项配置,可以使得frpc可以绑定端口,并使用此端口往my_server发送数据。
Describe alternatives you've considered
No response
Affected area
@Becods commented on GitHub (Sep 27, 2022):
@Wai5888 commented on GitHub (Sep 28, 2022):
可能我没有表达清楚,frpc的配置里面,local_port是用来监听并将数据传输给remote_port的,但是传给remote_port的时候,使用的端口并非是local_port。
它现在的实现是这样的:
frps-->frpc(local_port)
frpc(random_port)->my_server
而我希望,能够实现
frps-->frpc(local_port)
frpc(local_port2)->my_server
@huanghe-1 commented on GitHub (Sep 28, 2022):
@Wai5888 你是要做p2p桥接呢吧,my-server和dst_server都是server,谁做client呢?两个server都在nat后面,没有公网ip?
@Wai5888 commented on GitHub (Sep 28, 2022):
my_server和dst_server都是server,互为client,其实就类似P2P。只是FRP的P2P模式下,依旧会监听指定端口,使用随机端口去访问被代理的端口。这不是我想要的,因为my_server和dst_server都需要对数据从哪个端口发过来的做校验。
@huanghe-1 commented on GitHub (Sep 28, 2022):
你这是桥接啊,实际上两端都是client,需要一个server 服务开两个端口,把两个client串起来,这种frp是实现不了的,你其实需要的是一个tcp client转tcp server,这样另一个tcp client就可以连接这个sever端口了。
@Wai5888 commented on GitHub (Sep 30, 2022):
目前的FRPC是不支持,所以希望作者评估一下能不能做。因为反代使用的socket应该是可以bind端口的。
@fatedier commented on GitHub (Sep 30, 2022):
考虑:
@Wai5888 commented on GitHub (Sep 30, 2022):
1、这个场景确实比较少见,常用于P2P。主要是被代理的应用需要明确知道报文的地址信息(IP地址、端口),判断是否与之前配置一致。我这边刚好就有这样的应用。
2、目前我知道nginx采用的也是使用随机端口访问被反代的服务器。
3、其实这个功能也依旧是原有的功能,仅仅只是在创建socket的使用,要走一个分支,需要指定端口则bind,不需要则使用随机端口
@github-actions[bot] commented on GitHub (Feb 16, 2024):
Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
@Wai5888 commented on GitHub (Feb 20, 2024):
回复一下,激活此issue
@fatedier commented on GitHub (Feb 20, 2024):
综合考虑上面的几个问题,这个 feature 不在计划之中,如果有需求,建议结合其他工具使用,例如转发给一个其他的代理,再由支持此功能的代理通过指定的本地端口访问。
@github-actions[bot] commented on GitHub (Mar 13, 2024):
Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.