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

This commit is contained in:
Viktor Liu
2026-06-28 16:10:22 +02:00
parent 5968cff242
commit 3a6d4cfeab
16 changed files with 196 additions and 30 deletions
+11
View File
@@ -136,6 +136,17 @@ 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 errors.New("proxy not started")
}
if _, err := p.remoteConn.Write(b); err != nil {
return err
}
return nil
}
func (p *ProxyBind) close() error {
if p.remoteConn == nil {
return nil