I'm developing a web site that is served by the web server NGINX installed on a Linux platform. One of the service provided by the web site is base on a WebSocket backend server.

To be more specific the NGINX configuration establishes that when NGINX receive from the client a request of the type:

GET /websockify HTTP/1.1

the request is redirected (proxied) to the WebSocket backend server. These configuration is achived by the following block of settings:

location /websockify {
    proxy_pass http://backend;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

Sniffing by Wireshark I have seen that the client sends an HTTP request with the following 2 header in the HTTP request:

Connection: Upgrade
Upgrade: websocket

and NGINX sends an HTTP response of the type:

101 Swiching Protocols

After that (in base of Wireshark info) the communication switches from HTTP to a different protocol called WebSocket that I don't know.

Sometimes my Firefox browser, that in this context work obviously as a client, stops work and is not able to establish a connection with the WebSocket backend server.

To be sure that there are not present some errors in the web site configuration I would like to ask: the Protocols Switching is implemented by the browser? After this switching the browser starts to send data in a different manner than before the switching?

All other information about this topic are appreciated.


1 Answer 1


The WebSocket wikipedia page seems to have a good overview, and, further down the page, a description of the handshake that the client and server code use to switch their protocol from HTTP to WebSocket.

  • Thanks. If you have some other info relative to your direct experience with WebSocket I will happy to receive that.
    – User051209
    Commented Oct 14, 2022 at 12:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .