DialerProxy: Fix SplitHTTP H3 dialerProxy (#3570)

* wip

* wip

* formatting

* cnc connection no longer needs to be a Packetconn

* dialerProxy: do not cancel connection when Dial context is cancelled
This commit is contained in:
mmmray 2024-08-11 18:58:52 +02:00 committed by GitHub
parent 0c7303960a
commit 498d8eb3cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 7 deletions

View file

@ -118,7 +118,7 @@ func getHTTPClient(ctx context.Context, dest net.Destination, streamSettings *in
return nil, err
}
var udpConn *net.UDPConn
var udpConn net.PacketConn
var udpAddr *net.UDPAddr
switch c := conn.(type) {
@ -139,7 +139,11 @@ func getHTTPClient(ctx context.Context, dest net.Destination, streamSettings *in
return nil, err
}
default:
return nil, errors.New("unsupported connection type: %T", conn)
udpConn = &internet.FakePacketConn{c}
udpAddr, err = net.ResolveUDPAddr("udp", c.RemoteAddr().String())
if err != nil {
return nil, err
}
}
return quic.DialEarly(ctx, udpConn, udpAddr, tlsCfg, cfg)