diff --git a/connection/protocol.go b/connection/protocol.go index 2f6dea92..c4f5ed67 100644 --- a/connection/protocol.go +++ b/connection/protocol.go @@ -172,7 +172,10 @@ func NewProtocolSelector( http2Percentage, err := fetchFunc() if err != nil { - return nil, err + log.Err(err).Msg("Unable to lookup protocol. Defaulting to `http2`. If this fails, you can set `--protocol h2mux` in your cloudflared command.") + return &staticProtocolSelector{ + current: HTTP2, + }, nil } if protocolFlag == HTTP2.String() { if http2Percentage < 0 { diff --git a/connection/protocol_test.go b/connection/protocol_test.go index a119ec42..b4a6299a 100644 --- a/connection/protocol_test.go +++ b/connection/protocol_test.go @@ -158,7 +158,8 @@ func TestNewProtocolSelector(t *testing.T) { protocol: "unknown", fetchFunc: mockFetcherWithError(), namedTunnelConfig: testNamedTunnelConfig, - wantErr: true, + expectedProtocol: HTTP2, + wantErr: false, }, }