SIGN IN SIGN UP
fatedier / frp UNCLAIMED

A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.

0 0 72 Go

client/proxy: unify work conn wrapping across all proxy types (#5212)

* client/proxy: extract wrapWorkConn to deduplicate UDP/SUDP connection wrapping

Move the repeated rate-limiting, encryption, and compression wrapping
logic from UDPProxy and SUDPProxy into a shared BaseProxy.wrapWorkConn
method, reducing ~18 lines of duplication in each proxy type.

* client/proxy: unify work conn wrapping with pooled compression for all proxy types

Refactor wrapWorkConn to accept encKey parameter and return
(io.ReadWriteCloser, recycleFn, error), enabling HandleTCPWorkConnection
to reuse the same limiter/encryption/compression pipeline.

Switch all proxy types from WithCompression to WithCompressionFromPool.
TCP non-plugin path calls recycleFn via defer after Join; plugin and
UDP/SUDP paths skip recycle (objects are GC'd safely, per golib contract).
F
fatedier committed
cf396563f8ebf86d74ae849b0f2a5c33269203e8
Parent: 0b4f83c
Committed by GitHub <noreply@github.com> on 3/6/2026, 5:33:37 PM