Browse Source

speed test

Abhishek Kondur 2 years ago
parent
commit
ccd76f438b
2 changed files with 4 additions and 4 deletions
  1. 2 2
      nm-proxy/proxy/wireguard.go
  2. 2 2
      nm-proxy/server/server.go

+ 2 - 2
nm-proxy/proxy/wireguard.go

@@ -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)
 
 		}
 	}

+ 2 - 2
nm-proxy/server/server.go

@@ -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)
 		}
 
 	}