Feature: support VMess HTTP/2 transport (#903)

This commit is contained in:
小傅Fox
2020-09-26 20:33:57 +08:00
committed by GitHub
parent 8766287e72
commit 5bd189f2d0
4 changed files with 147 additions and 0 deletions

View File

@ -9,6 +9,7 @@ type TLSConfig struct {
Host string
SkipCertVerify bool
SessionCache tls.ClientSessionCache
NextProtos []string
}
func StreamTLSConn(conn net.Conn, cfg *TLSConfig) (net.Conn, error) {
@ -16,6 +17,7 @@ func StreamTLSConn(conn net.Conn, cfg *TLSConfig) (net.Conn, error) {
ServerName: cfg.Host,
InsecureSkipVerify: cfg.SkipCertVerify,
ClientSessionCache: cfg.SessionCache,
NextProtos: cfg.NextProtos,
}
tlsConn := tls.Client(conn, tlsConfig)