speed test

This commit is contained in:
Abhishek Kondur 2022-11-15 23:06:32 +05:30
parent a75879109a
commit ccd76f438b
2 changed files with 4 additions and 4 deletions

View file

@ -59,7 +59,7 @@ func (p *Proxy) ProxyToRemote() {
log.Println("ERRR READ: ", err)
continue
}
go func() {
go func(buf []byte, n int) {
if peerI, ok := peers[p.Config.RemoteKey]; ok {
var srcPeerKeyHash, dstPeerKeyHash string
@ -80,7 +80,7 @@ func (p *Proxy) ProxyToRemote() {
if err != nil {
log.Println("Failed to send to remote: ", err)
}
}()
}(buf, n)
}
}

View file

@ -59,7 +59,7 @@ func (p *ProxyServer) Listen(ctx context.Context) {
log.Println("RECV ERROR: ", err)
continue
}
go func() {
go func(buffer []byte, source *net.UDPAddr, n int) {
var srcPeerKeyHash, dstPeerKeyHash string
n, srcPeerKeyHash, dstPeerKeyHash = packet.ExtractInfo(buffer, n)
@ -143,7 +143,7 @@ func (p *ProxyServer) Listen(ctx context.Context) {
// }
// }
}()
}(buffer, source, n)
}
}