TUN-3400: Use Go HTTP2 library as transport to connect with the edge

This commit is contained in:
cthuang
2020-09-11 23:02:34 +01:00
parent d7498b0c03
commit 8d7b2575ba
7 changed files with 324 additions and 37 deletions

View File

@@ -9,7 +9,7 @@ import (
"github.com/pkg/errors"
)
// DialEdge makes a TLS connection to a Cloudflare edge node
// DialEdgeWithH2Mux makes a TLS connection to a Cloudflare edge node
func DialEdge(
ctx context.Context,
timeout time.Duration,
@@ -25,6 +25,7 @@ func DialEdge(
if err != nil {
return nil, newDialError(err, "DialContext error")
}
tlsEdgeConn := tls.Client(edgeConn, tlsConfig)
tlsEdgeConn.SetDeadline(time.Now().Add(timeout))