Add ping proxy support

This commit is contained in:
世界 2025-02-17 21:56:18 +08:00
parent 4a56d47035
commit 933bd2b2d5
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
16 changed files with 542 additions and 19 deletions

View file

@ -58,7 +58,7 @@ func (f *UDPForwarder) HandlePacket(id stack.TransportEndpointID, pkt *stack.Pac
func rangeIterate(r stack.Range, fn func(*buffer.View))
func (f *UDPForwarder) PreparePacketConnection(source M.Socksaddr, destination M.Socksaddr, userData any) (bool, context.Context, N.PacketWriter, N.CloseHandlerFunc) {
pErr := f.handler.PrepareConnection(N.NetworkUDP, source, destination)
_, pErr := f.handler.PrepareConnection(N.NetworkUDP, source, destination, nil)
if pErr != nil {
if !errors.Is(pErr, ErrDrop) {
gWriteUnreachable(f.stack, userData.(*stack.PacketBuffer))