mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-04-03 03:47:39 +03:00
Revert "Update udpant usages"
This commit is contained in:
parent
59a6bdc1fa
commit
091b5da950
5 changed files with 8 additions and 22 deletions
|
@ -37,16 +37,10 @@ func NewUDPForwarder(ctx context.Context, stack *stack.Stack, handler Handler, t
|
|||
stack: stack,
|
||||
handler: handler,
|
||||
}
|
||||
udpNat := udpnat.New(handler, forwarder.PreparePacketConnection, timeout, true)
|
||||
udpNat.Start()
|
||||
forwarder.udpNat = udpNat
|
||||
forwarder.udpNat = udpnat.New(handler, forwarder.PreparePacketConnection, timeout, true)
|
||||
return forwarder
|
||||
}
|
||||
|
||||
func (f *UDPForwarder) Close() {
|
||||
f.udpNat.Close()
|
||||
}
|
||||
|
||||
func (f *UDPForwarder) HandlePacket(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool {
|
||||
source := M.SocksaddrFrom(AddrFromAddress(id.RemoteAddress), id.RemotePort)
|
||||
destination := M.SocksaddrFrom(AddrFromAddress(id.LocalAddress), id.LocalPort)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue