Add tcpMptcp to sockopt (#2520)

This commit is contained in:
yylt 2023-09-08 01:32:27 +08:00 committed by GitHub
parent 853a866622
commit c00e56c0da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 26 deletions

View file

@ -81,6 +81,9 @@ func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest ne
}
if sockopt != nil || len(d.controllers) > 0 {
if sockopt != nil && sockopt.TcpMptcp {
dialer.SetMultipathTCP(true)
}
dialer.Control = func(network, address string, c syscall.RawConn) error {
for _, ctl := range d.controllers {
if err := ctl(network, address, c); err != nil {