mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[PR #3488] [MERGED] server/proxy: simplify the code #4759
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#4759
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?
📋 Pull Request Information
Original PR: https://github.com/fatedier/frp/pull/3488
Author: @fatedier
Created: 6/15/2023
Status: ✅ Merged
Merged: 6/15/2023
Merged by: @fatedier
Base:
dev← Head:code📝 Commits (1)
12a1233server/proxy: simplify the code📊 Changes
10 files changed (+209 additions, -147 deletions)
View changed files
📝
pkg/nathole/controller.go(+1 -0)📝
server/proxy/http.go(+16 -5)📝
server/proxy/https.go(+17 -7)📝
server/proxy/proxy.go(+57 -83)📝
server/proxy/stcp.go(+17 -6)📝
server/proxy/sudp.go(+17 -6)📝
server/proxy/tcp.go(+27 -16)📝
server/proxy/tcpmux.go(+17 -7)📝
server/proxy/udp.go(+24 -12)📝
server/proxy/xtcp.go(+16 -5)📄 Description
Summary
🤖 Generated by Copilot at
12a1233This pull request refactors the
proxypackage to use a proxy factory registry, simplify the creation and handling of different proxy types, and add support for new proxy types such asHTTPProxy,TCPMuxProxy, andXTCPProxy. It also adds a TODO comment topkg/nathole/controller.goto handle name conflicts in the NAT hole punching service.WHY
Walkthrough
🤖 Generated by Copilot at
12a1233reflectpackage to create proxies based on their configuration types (link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link)startCommonTCPListenersHandlerdefined in theBaseProxytype to start goroutine handlers for TCP-based proxies, instead of using thestartListenHandlerfunction (link,link,link,link,link,link)BaseProxytype, instead of calling theGetConffunction of the proxy, in the functionHandleUserTCPConnectionand the proxy handlers (link,link,link)realPorttorealBindPortin theTCPProxy,UDPProxy, andXTCPProxytypes, which reflects the fact that this field stores the port that the proxy binds to on the server side (link,link,link,link,link)GetLimiterfunction from theHTTPProxy,HTTPSProxy,STCPProxy,SUDPProxy,TCPMuxProxy, andXTCPProxytypes, and use theGetLimiterfunction defined in theBaseProxytype instead (link,link,link,link,link,link,link)ListenClientinpkg/nathole/controller.goto handle the case where a client tries to register a name that already exists in the NAT hole punching service (link)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.