[PR #3351] [MERGED] frpc: add parameter nat_hole_server_addr #4729

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

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/3351
Author: @fatedier
Created: 3/10/2023
Status: Merged
Merged: 3/10/2023
Merged by: @fatedier

Base: devHead: nathole


📝 Commits (1)

  • 2bd1959 frpc: add parameter nat_hole_server_addr

📊 Changes

4 files changed (+17 additions, -2 deletions)

View changed files

📝 client/proxy/proxy.go (+5 -1)
📝 client/visitor.go (+5 -1)
📝 conf/frpc_full.ini (+4 -0)
📝 pkg/config/client.go (+3 -0)

📄 Description

🤖 Generated by Copilot at 2bd1959

Summary

🕳️🔌⚙️

Add a new option nat_hole_server_addr to the client configuration to allow specifying another address of the server to connect for nat hole. This option affects the UDP connection logic in client/proxy/proxy.go and client/visitor.go.

nat_hole address
client can choose another
firewall, no problem

Walkthrough

  • Add a new option nat_hole_server_addr to the client configuration file conf/frpc_full.ini and the corresponding field NatHoleServerAddr to the ClientCommonConf struct in pkg/config/client.go to allow the client to specify another address of the server to connect for nat hole (link, link)
  • Use the NatHoleServerAddr field to create a UDP connection to the server for nat hole in the InWorkConn function in client/proxy/proxy.go and the handleConn function in client/visitor.go, which are responsible for the proxy and visitor sides respectively (link, 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/3351 **Author:** [@fatedier](https://github.com/fatedier) **Created:** 3/10/2023 **Status:** ✅ Merged **Merged:** 3/10/2023 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `nathole` --- ### 📝 Commits (1) - [`2bd1959`](https://github.com/fatedier/frp/commit/2bd195918ec8caf26c4e53ee7860071e748fe32e) frpc: add parameter nat_hole_server_addr ### 📊 Changes **4 files changed** (+17 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `client/proxy/proxy.go` (+5 -1) 📝 `client/visitor.go` (+5 -1) 📝 `conf/frpc_full.ini` (+4 -0) 📝 `pkg/config/client.go` (+3 -0) </details> ### 📄 Description <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at 2bd1959</samp> ### Summary 🕳️🔌⚙️ <!-- 1. 🕳️ - This emoji represents a hole, which is related to the concept of nat hole, a technique to create a hole in the firewall or router for incoming connections. 2. 🔌 - This emoji represents a plug, which is related to the concept of connection, a link between the client and the server or another client for nat hole. 3. ⚙️ - This emoji represents a gear, which is related to the concept of configuration, a set of options that the user can customize for the client. --> Add a new option `nat_hole_server_addr` to the client configuration to allow specifying another address of the server to connect for nat hole. This option affects the UDP connection logic in `client/proxy/proxy.go` and `client/visitor.go`. > _`nat_hole` address_ > _client can choose another_ > _firewall, no problem_ ### Walkthrough * Add a new option `nat_hole_server_addr` to the client configuration file `conf/frpc_full.ini` and the corresponding field `NatHoleServerAddr` to the `ClientCommonConf` struct in `pkg/config/client.go` to allow the client to specify another address of the server to connect for nat hole ([link](https://github.com/fatedier/frp/pull/3351/files?diff=unified&w=0#diff-12bf97fbdf713937ce234cefa7dd9244ac8f86ca1c32e8b5af7aa8232bef5983R9-R12), [link](https://github.com/fatedier/frp/pull/3351/files?diff=unified&w=0#diff-fd40de974f57bca0b0360aa388aae106227b36be701f6c5fedbd511a6f39a062R38-R40)) * Use the `NatHoleServerAddr` field to create a UDP connection to the server for nat hole in the `InWorkConn` function in `client/proxy/proxy.go` and the `handleConn` function in `client/visitor.go`, which are responsible for the proxy and visitor sides respectively ([link](https://github.com/fatedier/frp/pull/3351/files?diff=unified&w=0#diff-e7005325b1c025aff14dc50c8eb543e39d5ddcd6628e973ea6b5b12fa146a18aL308-R313), [link](https://github.com/fatedier/frp/pull/3351/files?diff=unified&w=0#diff-19a706a22d1a3b072f4396701827971d500fc88483c3e3f3f3b7ce19e16e0d2aL213-R218)) --- <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:47:38 -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#4729
No description provided.