What is WebSocket and how does it get through proxies?
IntermediateConceptHTTP, TLS & Certificates
Answer
A WebSocket starts as an HTTP/1.1 request with Upgrade: websocket and Connection: Upgrade, receives 101 Switching Protocols, then becomes a long-lived bidirectional channel. Proxies need to pass those hop-by-hop headers and use long timeouts.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 3600s;
More on HTTP, TLS & Certificates
What is the structure of an HTTP request and response?BeginnerWhich HTTP status code classes and codes should every DevOps engineer know?BeginnerWhat are the common HTTP methods and which are idempotent?BeginnerWhat changed between HTTP/1.1, HTTP/2 and HTTP/3?IntermediateHow does QUIC differ from TCP+TLS?AdvancedWhat are HTTP keep-alive and connection reuse, and why do they matter?Advanced