[PR #3489] [MERGED] fix the issue of duplicate xtcp proxies will cause the previous proxy to become ineffective #4761

Closed
opened 2026-05-05 14:48:14 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/3489
Author: @fatedier
Created: 6/15/2023
Status: Merged
Merged: 6/15/2023
Merged by: @fatedier

Base: devHead: code


📝 Commits (1)

  • e61f609 fix the issue of duplicate xtcp proxies will cause the previous proxy to become ineffective

📊 Changes

5 files changed (+24 additions, -7 deletions)

View changed files

📝 pkg/nathole/controller.go (+5 -3)
📝 server/control.go (+5 -0)
📝 server/proxy/proxy.go (+7 -0)
📝 server/proxy/xtcp.go (+4 -1)
📝 test/e2e/basic/server.go (+3 -3)

📄 Description

Summary

🤖 Generated by Copilot at e61f609

Improved validation and error handling for proxy names in nathole, control, and xtcp packages. Changed test ports to avoid conflicts with nathole package.

WHY

Walkthrough

🤖 Generated by Copilot at e61f609

  • Prevent the registration of repeated proxies and potential conflicts by checking the proxy name in the pxyManager and the clientCfgs map (link, link, link)
  • Return an error from the ListenClient function in the nathole package if the proxy name is invalid or duplicated and handle it in the Run function in the xtcp package (link, link)
  • Change the remote ports of the TCP and UDP echo servers in the test/e2e/basic/server.go file to avoid the port conflict with the nathole package (link, link)
  • Update the port of the not allowed request in the test/e2e/basic/server.go file to test the case when the client tries to access a port that is not allowed by the server (link)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fatedier/frp/pull/3489 **Author:** [@fatedier](https://github.com/fatedier) **Created:** 6/15/2023 **Status:** ✅ Merged **Merged:** 6/15/2023 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `code` --- ### 📝 Commits (1) - [`e61f609`](https://github.com/fatedier/frp/commit/e61f609424828fea2b235b119db4453e382d94dc) fix the issue of duplicate xtcp proxies will cause the previous proxy to become ineffective ### 📊 Changes **5 files changed** (+24 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `pkg/nathole/controller.go` (+5 -3) 📝 `server/control.go` (+5 -0) 📝 `server/proxy/proxy.go` (+7 -0) 📝 `server/proxy/xtcp.go` (+4 -1) 📝 `test/e2e/basic/server.go` (+3 -3) </details> ### 📄 Description ### Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at e61f609</samp> Improved validation and error handling for proxy names in `nathole`, `control`, and `xtcp` packages. Changed test ports to avoid conflicts with `nathole` package. ### WHY <!-- author to complete --> ### Walkthrough <!-- copilot:walkthrough --> ### <samp>🤖 Generated by Copilot at e61f609</samp> * Prevent the registration of repeated proxies and potential conflicts by checking the proxy name in the `pxyManager` and the `clientCfgs` map ([link](https://github.com/fatedier/frp/pull/3489/files?diff=unified&w=0#diff-292ec4fee0964ed74268d2a5345341096a228f932403bbb4acd1d3e94405d891R580-R584), [link](https://github.com/fatedier/frp/pull/3489/files?diff=unified&w=0#diff-2f15ef36bc925196e99eb8971b235db30a64a9c44c6ac37215abdaaac812777fL133-R137), [link](https://github.com/fatedier/frp/pull/3489/files?diff=unified&w=0#diff-1934fd5992845347455fe5e26d6ed40e53ba26f246a0fc9c3d4a70efdbbad6e6R327-R333)) * Return an error from the `ListenClient` function in the `nathole` package if the proxy name is invalid or duplicated and handle it in the `Run` function in the `xtcp` package ([link](https://github.com/fatedier/frp/pull/3489/files?diff=unified&w=0#diff-2f15ef36bc925196e99eb8971b235db30a64a9c44c6ac37215abdaaac812777fL124-R124), [link](https://github.com/fatedier/frp/pull/3489/files?diff=unified&w=0#diff-52f5ffea2008402b178846549fb887fd3961403113f5a846202923dc48936b1cL61-R64)) * Change the remote ports of the TCP and UDP echo servers in the `test/e2e/basic/server.go` file to avoid the port conflict with the `nathole` package ([link](https://github.com/fatedier/frp/pull/3489/files?diff=unified&w=0#diff-ebf6cb4ccb64fd8ab33798402e776bbb502d3f13be272a797c5ea66a937eca1bL40-R40), [link](https://github.com/fatedier/frp/pull/3489/files?diff=unified&w=0#diff-ebf6cb4ccb64fd8ab33798402e776bbb502d3f13be272a797c5ea66a937eca1bL58-R58)) * Update the port of the not allowed request in the `test/e2e/basic/server.go` file to test the case when the client tries to access a port that is not allowed by the server ([link](https://github.com/fatedier/frp/pull/3489/files?diff=unified&w=0#diff-ebf6cb4ccb64fd8ab33798402e776bbb502d3f13be272a797c5ea66a937eca1bL68-R68)) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:48:14 -06:00
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#4761
No description provided.