diff --git a/proxy/socks/client.go b/proxy/socks/client.go index b4b5470..1ac6bab 100755 --- a/proxy/socks/client.go +++ b/proxy/socks/client.go @@ -87,12 +87,15 @@ func (c *socksUDPConn) WriteTo(b []byte, addr net.Addr) (n int, err error) { func (c *socksUDPConn) ReadFrom(b []byte) (int, net.Addr, error) { n, a, e := c.PacketConn.ReadFrom(b) + if e != nil { + return 0, nil, e + } addr, payload, err := DecodeUDPPacket(b) if err != nil { return 0, nil, err } copy(b, payload) - return n - len(addr) - 3, a, e + return n - len(addr) - 3, a, nil } func (c *socksUDPConn) Close() error {