cloudflare / cloudflare/cloudflared

Stop TCP connections from lingering for 60 seconds

Aperta
#97 1 commento 0 reazioni 1 assegnatario Rivendicata da @acmacalister Vedi su GitHub
Confirmed
Lingua principale
Go
Stelle
15.6k
Fork
1.4k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

When `cloudflared` is used for plain TCP tunnels (`ssh://` and `rdp://` URLs), the connections to the server stay open and idle for 60 seconds after the client has closed the TCP connection on its end. This was probably originally meant for utilizing HTTP Keep-alive connections, but it doesn't make sense with non-HTTP traffic. I suspect these lingering open connections were the reason why we saw calls to our API getting stuck over Argo tunnel after lots of short-lived connections, which were not so short-lived on the server side.

By experimenting a bit, I found that [here is the hard-coded value](https://github.com/cloudflare/cloudflared/blob/137928ecafec1ee98abc46377e07ce046b6b3e45/websocket/websocket.go#L23) (`pongWait`) that specifies how long the connections stay open. If it still makes sense to keep them open when HTTP proxying, maybe there should be an option to set it from the command line, and/or it should be set to 0 when proxying to `ssh://` and `rdp://` URLs.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.