[GH-ISSUE #1334] TCP端口重复问题 #1057

Closed
opened 2026-05-05 12:40:43 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @wzjjack on GitHub (Jul 22, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1334

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)
(请不要在 issue 评论中出现无意义的 加1我也是 等内容,将会被直接删除。)
(由于个人精力有限,和系统环境,网络环境等相关的求助问题请转至其他论坛或社交平台。)

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
0.13.0

What operating system and processor architecture are you using (go env)?
go env

Configures you used:

[common]
server_addr = xxx.com
server_port = 10000
privilege_token = FRP_SERVICE_TOKEN

[FRP_SERVICE_NAME]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = FRP_SERVICE_PORT
use_encryption = true

Steps to reproduce the issue:
systemctl start frpc.service
尝试用重复的port去连接,会有日志报出:listen tcp 0.0.0.0:9784: bind: address already in use
执行systemctl is-active frpc.service查看发现,service是active,启动成功的

Describe the results you received:

Describe the results you expected:
最新版本是否可以选择配置如果端口重复的话就终止启动服务

Additional information you deem important (e.g. issue happens only occasionally):

Can you point out what caused this issue (optional)

Originally created by @wzjjack on GitHub (Jul 22, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1334 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) (请不要在 issue 评论中出现无意义的 **加1**,**我也是** 等内容,将会被直接删除。) (由于个人精力有限,和系统环境,网络环境等相关的求助问题请转至其他论坛或社交平台。) Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST **What version of frp are you using (./frpc -v or ./frps -v)?** 0.13.0 **What operating system and processor architecture are you using (`go env`)?** `go env` **Configures you used:** ``` [common] server_addr = xxx.com server_port = 10000 privilege_token = FRP_SERVICE_TOKEN [FRP_SERVICE_NAME] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = FRP_SERVICE_PORT use_encryption = true ``` **Steps to reproduce the issue:** `systemctl start frpc.service` 尝试用重复的port去连接,会有日志报出:`listen tcp 0.0.0.0:9784: bind: address already in use` 执行`systemctl is-active frpc.service`查看发现,service是active,启动成功的 **Describe the results you received:** **Describe the results you expected:** 最新版本是否可以选择配置如果端口重复的话就终止启动服务 **Additional information you deem important (e.g. issue happens only occasionally):** **Can you point out what caused this issue (optional)**
Author
Owner

@fatedier commented on GitHub (Jul 23, 2019):

不可以,你可以尝试将 remote_port 设置为 0 使用随机端口,或自行写脚本进行检测,如果启动失败,就将进程停掉。

<!-- gh-comment-id:514031130 --> @fatedier commented on GitHub (Jul 23, 2019): 不可以,你可以尝试将 remote_port 设置为 0 使用随机端口,或自行写脚本进行检测,如果启动失败,就将进程停掉。
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#1057
No description provided.