mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-27 06:49:07 +01:00
Reinject captured first packet on lazy peer activation and keep peer alive across endpoint swap
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user