mirror of https://github.com/v2ray/v2ray-core
send to UDP dest
parent
383eb57487
commit
6b9cb3f80d
|
@ -72,7 +72,7 @@ func (this *Shadowsocks) Listen(port v2net.Port) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Shadowsocks) handlerUDPPayload(payload *alloc.Buffer, dest v2net.Destination) {
|
func (this *Shadowsocks) handlerUDPPayload(payload *alloc.Buffer, source v2net.Destination) {
|
||||||
defer payload.Release()
|
defer payload.Release()
|
||||||
|
|
||||||
iv := payload.Value[:this.config.Cipher.IVSize()]
|
iv := payload.Value[:this.config.Cipher.IVSize()]
|
||||||
|
@ -90,7 +90,9 @@ func (this *Shadowsocks) handlerUDPPayload(payload *alloc.Buffer, dest v2net.Des
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
packet := v2net.NewPacket(v2net.TCPDestination(request.Address, request.Port), request.UDPPayload, false)
|
dest := v2net.UDPDestination(request.Address, request.Port)
|
||||||
|
log.Info("Shadowsocks: Tunnelling request to ", dest)
|
||||||
|
packet := v2net.NewPacket(dest, request.UDPPayload, false)
|
||||||
ray := this.space.PacketDispatcher().DispatchToOutbound(packet)
|
ray := this.space.PacketDispatcher().DispatchToOutbound(packet)
|
||||||
close(ray.InboundInput())
|
close(ray.InboundInput())
|
||||||
|
|
||||||
|
@ -127,7 +129,7 @@ func (this *Shadowsocks) handlerUDPPayload(payload *alloc.Buffer, dest v2net.Des
|
||||||
respAuth.Authenticate(response.Value, response.Value[this.config.Cipher.IVSize():])
|
respAuth.Authenticate(response.Value, response.Value[this.config.Cipher.IVSize():])
|
||||||
}
|
}
|
||||||
|
|
||||||
this.udpHub.WriteTo(response.Value, dest)
|
this.udpHub.WriteTo(response.Value, source)
|
||||||
response.Release()
|
response.Release()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue