Skip to content

Commit

Permalink
Additional clean-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed Sep 23, 2024
1 parent 2225cf6 commit a8a25a9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ipproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ func (p *proxy) Start(ctx context.Context) error {
// tcpReceiveBufferSize if set to zero, the default receive window buffer size is used instead.
const tcpReceiveBufferSize = 0
const maxInFlightConnectionAttempts = 1024
tcpFwd := tcp.NewForwarder(p.ipstack, tcpReceiveBufferSize, maxInFlightConnectionAttempts, p.onTCP)
udpFwd := udp.NewForwarder(p.ipstack, p.onUDP)
tcpFwd := tcp.NewForwarder(ipstack, tcpReceiveBufferSize, maxInFlightConnectionAttempts, p.onTCP)
udpFwd := udp.NewForwarder(ipstack, p.onUDP)

p.ipstack.SetTransportProtocolHandler(tcp.ProtocolNumber, tcpFwd.HandlePacket)
p.ipstack.SetTransportProtocolHandler(udp.ProtocolNumber, udpFwd.HandlePacket)
ipstack.SetTransportProtocolHandler(tcp.ProtocolNumber, tcpFwd.HandlePacket)
ipstack.SetTransportProtocolHandler(udp.ProtocolNumber, udpFwd.HandlePacket)

p.ipstack.Wait()
ipstack.Wait()

return nil
}
Expand Down

0 comments on commit a8a25a9

Please sign in to comment.