TUN-6704: Honor protocol flag when edge discovery is unreachable

This commit is contained in:
Devin Carr 2022-08-25 12:01:16 -07:00
parent e3390fcb15
commit af6bf5c4e5
1 changed files with 2 additions and 2 deletions

View File

@ -209,8 +209,8 @@ func NewProtocolSelector(
threshold := switchThreshold(namedTunnel.Credentials.AccountTag)
fetchedProtocol, err := getProtocol([]Protocol{QUIC, HTTP2}, fetchFunc, threshold)
if err != nil {
log.Err(err).Msg("Unable to lookup protocol. Defaulting to `http2`. If this fails, you can set `--protocol h2mux` in your cloudflared command.")
if err != nil && protocolFlag == "auto" {
log.Err(err).Msg("Unable to lookup protocol. Defaulting to `http2`. If this fails, you can attempt `--protocol quic` instead.")
return &staticProtocolSelector{
current: HTTP2,
}, nil