mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-05-11 23:46:36 +00:00

cloudflared falls back aggressively to HTTP/2 protocol if a connection attempt with QUIC failed. This was done to ensure that machines with UDP egress disabled did not stop clients from connecting to the cloudlfare edge. This PR improves on that experience by having cloudflared remember if a QUIC connection was successful which implies UDP egress works. In this case, cloudflared does not fallback to HTTP/2 and keeps trying to connect to the edge with QUIC.
29 lines
852 B
Go
29 lines
852 B
Go
package connection
|
|
|
|
// Event is something that happened to a connection, e.g. disconnection or registration.
|
|
type Event struct {
|
|
Index uint8
|
|
EventType Status
|
|
Location string
|
|
Protocol Protocol
|
|
URL string
|
|
}
|
|
|
|
// Status is the status of a connection.
|
|
type Status int
|
|
|
|
const (
|
|
// Disconnected means the connection to the edge was broken.
|
|
Disconnected Status = iota
|
|
// Connected means the connection to the edge was successfully established.
|
|
Connected
|
|
// Reconnecting means the connection to the edge is being re-established.
|
|
Reconnecting
|
|
// SetURL means this connection's tunnel was given a URL by the edge. Used for quick tunnels.
|
|
SetURL
|
|
// RegisteringTunnel means the non-named tunnel is registering its connection.
|
|
RegisteringTunnel
|
|
// We're unregistering tunnel from the edge in preparation for a disconnect
|
|
Unregistering
|
|
)
|