[client] Reinject captured first packet on lazy connection activation (#6572)

This commit is contained in:
Viktor Liu
2026-06-30 11:22:25 +02:00
committed by GitHub
parent 5b5f11740a
commit 4ef65294e9
15 changed files with 169 additions and 36 deletions
+11
View File
@@ -219,6 +219,17 @@ func (p *ProxyWrapper) RedirectAs(endpoint *net.UDPAddr) {
p.pausedCond.L.Unlock()
}
// InjectPacket writes b to the remote peer over the underlying transport.
func (p *ProxyWrapper) InjectPacket(b []byte) error {
if p.remoteConn == nil {
return errors.New("proxy not started")
}
if _, err := p.remoteConn.Write(b); err != nil {
return err
}
return nil
}
// CloseConn close the remoteConn and automatically remove the conn instance from the map
func (p *ProxyWrapper) CloseConn() error {
if p.cancel == nil {