feat: support sudp proxy (#1730)

This commit is contained in:
Tank authored and GitHub committed 2020-04-22 21:37:45 +08:00
1 parent 6d78af6144
commit 4797136965
15 files changed
+669 -1

No files matched your search

+1 -1
View File
@@ -57,11 +57,11 @@ func ForwardUserConn(udpConn *net.UDPConn, readCh <-chan *msg.UdpPacket, sendCh
for {
n, remoteAddr, err := udpConn.ReadFromUDP(buf)
if err != nil {
udpConn.Close()
return
}
// buf[:n] will be encoded to string, so the bytes can be reused
udpMsg := NewUdpPacket(buf[:n], nil, remoteAddr)
select {
case sendCh <- udpMsg:
default: