[GH-ISSUE #1957] 能否做到服务器随机端口,客服端收到服务器所代理的中转端口 #1555

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

Originally created by @lunrs on GitHub (Aug 26, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1957

背景:
一些游戏中转需要服务端随机自动(随机)分配端口,而google了很多文章都只写到随机服务器端口,看具体是哪一个端口需要去服务器上看,而这对于游戏中转而言不太现实
建议:
能不能做到服务器随机端口,客服端收到服务器所代理的中转端口

Originally created by @lunrs on GitHub (Aug 26, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/1957 背景: 一些游戏中转需要服务端随机自动(随机)分配端口,而google了很多文章都只写到随机服务器端口,看具体是哪一个端口需要去服务器上看,而这对于游戏中转而言不太现实 建议: 能不能做到服务器随机端口,客服端收到服务器所代理的中转端口
gitea-mirror 2026-05-05 12:59:09 -06:00
Author
Owner

@Becods commented on GitHub (Aug 26, 2020):

感觉你的需求是中转加速一类的东西吧
简洁描述,下文中 游戏服务端 我将称为server,游戏客户端 将称为client

server位于nat上,需要使用frp进行穿透
frpc自动映射server的随机端口,并自动通过frps通告client

不知对否
但是这样做仅仅会增加延迟,对游戏中转并无益处

<!-- gh-comment-id:680816335 --> @Becods commented on GitHub (Aug 26, 2020): 感觉你的需求是中转加速一类的东西吧 简洁描述,下文中 游戏服务端 我将称为server,游戏客户端 将称为client >server位于nat上,需要使用frp进行穿透 >frpc自动映射server的随机端口,并自动通过frps通告client 不知对否 但是这样做仅仅会增加延迟,对游戏中转并无益处
Author
Owner

@lunrs commented on GitHub (Aug 26, 2020):

感觉你的需求是中转加速一类的东西吧
简洁描述,下文中 游戏服务端 我将称为server,游戏客户端 将称为client

server位于nat上,需要使用frp进行穿透
frpc自动映射server的随机端口,并自动通过frps通告client

不知对否
但是这样做仅仅会增加延迟,对游戏中转并无益处

就是这个意思,不过主要是用来内网穿透,实现一些游戏的点对点连接(client对client),以及隐藏client的ip地址

<!-- gh-comment-id:680838051 --> @lunrs commented on GitHub (Aug 26, 2020): > 感觉你的需求是中转加速一类的东西吧 > 简洁描述,下文中 游戏服务端 我将称为server,游戏客户端 将称为client > > > server位于nat上,需要使用frp进行穿透 > > frpc自动映射server的随机端口,并自动通过frps通告client > > 不知对否 > 但是这样做仅仅会增加延迟,对游戏中转并无益处 就是这个意思,不过主要是用来内网穿透,实现一些游戏的点对点连接(client对client),以及隐藏client的ip地址
Author
Owner

@Becods commented on GitHub (Aug 27, 2020):

感觉你的需求是中转加速一类的东西吧
简洁描述,下文中 游戏服务端 我将称为server,游戏客户端 将称为client

server位于nat上,需要使用frp进行穿透
frpc自动映射server的随机端口,并自动通过frps通告client

不知对否
但是这样做仅仅会增加延迟,对游戏中转并无益处

就是这个意思,不过主要是用来内网穿透,实现一些游戏的点对点连接(client对client),以及隐藏client的ip地址

详见xtcp
但是我觉得使用n2n或者zerotier这样的软件会更好些

<!-- gh-comment-id:681210373 --> @Becods commented on GitHub (Aug 27, 2020): > > 感觉你的需求是中转加速一类的东西吧 > > 简洁描述,下文中 游戏服务端 我将称为server,游戏客户端 将称为client > > > server位于nat上,需要使用frp进行穿透 > > > frpc自动映射server的随机端口,并自动通过frps通告client > > > > > > 不知对否 > > 但是这样做仅仅会增加延迟,对游戏中转并无益处 > > 就是这个意思,不过主要是用来内网穿透,实现一些游戏的点对点连接(client对client),以及隐藏client的ip地址 详见[xtcp](https://gofrp.org/docs/examples/xtcp/) 但是我觉得使用[n2n](https://github.com/ntop/n2n)或者[zerotier](https://www.zerotier.com/)这样的软件会更好些
Author
Owner

@fatedier commented on GitHub (Sep 21, 2020):

@lunrs 可以通过服务端 API 来获取这个端口。

<!-- gh-comment-id:696127969 --> @fatedier commented on GitHub (Sep 21, 2020): @lunrs 可以通过服务端 API 来获取这个端口。
Author
Owner

@github-actions[bot] commented on GitHub (Nov 6, 2020):

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

<!-- gh-comment-id:722734766 --> @github-actions[bot] commented on GitHub (Nov 6, 2020): Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d 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#1555
No description provided.