feat: use goroutines to process connections

This commit is contained in:
AkinoKaede 2023-05-30 23:00:53 +08:00 committed by Shelikhoo
parent 0a090a073b
commit c439a12d06
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
2 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ func SetTCPHandler(ctx context.Context, dispatcher routing.Dispatcher, policyMan
config: config,
}
handler.Handle(conn)
go handler.Handle(conn)
})
s.SetTransportProtocolHandler(tcp.ProtocolNumber, tcpForwarder.HandlePacket)

View File

@ -57,7 +57,7 @@ func SetUDPHandler(ctx context.Context, dispatcher routing.Dispatcher, policyMan
policyManager: policyManager,
config: config,
}
handler.Handle(conn)
go handler.Handle(conn)
})
s.SetTransportProtocolHandler(gvisor_udp.ProtocolNumber, udpForwarder.HandlePacket)
return nil