feat: allow set ListenUDP impl for udphop conn

Third-party clients can use this to set options on created sockets.
e.g. calling VpnService.protect() on Android.
This commit is contained in:
Haruue
2024-02-27 20:51:59 +08:00
parent ea66299d0f
commit 1ac9d4956b
2 changed files with 24 additions and 15 deletions

View File

@@ -179,7 +179,7 @@ func (c *clientConfig) fillConnFactory(hyConfig *client.Config) error {
if hyConfig.ServerAddr.Network() == "udphop" {
hopAddr := hyConfig.ServerAddr.(*udphop.UDPHopAddr)
newFunc = func(addr net.Addr) (net.PacketConn, error) {
return udphop.NewUDPHopPacketConn(hopAddr, c.Transport.UDP.HopInterval)
return udphop.NewUDPHopPacketConn(hopAddr, c.Transport.UDP.HopInterval, nil)
}
} else {
newFunc = func(addr net.Addr) (net.PacketConn, error) {