mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Merge from remote branch[ssh]
This commit is contained in:
parent
f45de76b4a
commit
30008fdf9c
|
@ -1,8 +1,10 @@
|
||||||
package vless
|
package vless
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
|
C "github.com/Dreamacro/clash/constant"
|
||||||
xtls "github.com/xtls/go"
|
xtls "github.com/xtls/go"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,6 +22,10 @@ func StreamXTLSConn(conn net.Conn, cfg *XTLSConfig) (net.Conn, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
xtlsConn := xtls.Client(conn, xtlsConfig)
|
xtlsConn := xtls.Client(conn, xtlsConfig)
|
||||||
err := xtlsConn.Handshake()
|
|
||||||
|
// fix tls handshake not timeout
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), C.DefaultTLSTimeout)
|
||||||
|
defer cancel()
|
||||||
|
err := xtlsConn.HandshakeContext(ctx)
|
||||||
return xtlsConn, err
|
return xtlsConn, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user