Reinject captured first packet on lazy peer activation and keep peer alive across endpoint swap

This commit is contained in:
Viktor Liu
2026-06-08 11:27:17 +02:00
parent 1e7b16db0a
commit acb2b9d619
16 changed files with 184 additions and 34 deletions
+9
View File
@@ -136,6 +136,15 @@ func (p *ProxyBind) CloseConn() error {
return p.close()
}
// InjectPacket writes b to the remote peer over the underlying transport.
func (p *ProxyBind) InjectPacket(b []byte) error {
if p.remoteConn == nil {
return fmt.Errorf("proxy not started")
}
_, err := p.remoteConn.Write(b)
return err
}
func (p *ProxyBind) close() error {
if p.remoteConn == nil {
return nil