TUN-2606: add DialEdge helpers

This commit is contained in:
Nick Vollmar
2019-11-21 12:10:44 -06:00
parent 92736b2677
commit 8f4fd70783
6 changed files with 70 additions and 66 deletions

View File

@@ -2,7 +2,6 @@ package connection
import (
"context"
"net"
"time"
"github.com/cloudflare/cloudflared/h2mux"
@@ -20,20 +19,12 @@ const (
openStreamTimeout = 30 * time.Second
)
type dialError struct {
cause error
}
func (e dialError) Error() string {
return e.cause.Error()
}
type Connection struct {
id uuid.UUID
muxer *h2mux.Muxer
}
func newConnection(muxer *h2mux.Muxer, edgeIP *net.TCPAddr) (*Connection, error) {
func newConnection(muxer *h2mux.Muxer) (*Connection, error) {
id, err := uuid.NewRandom()
if err != nil {
return nil, err