Browse Source

Update client.go

pull/15/head
Jason 5 years ago
parent
commit
31cca563c9
  1. 5
      proxy/socks/client.go

5
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 {

Loading…
Cancel
Save