Glad you asked. HTTP is not meant for keeping the connection open. It is the usage that matters. HTTP is designed to serve multiple requests a quickly as possible, hence open connection -> server -> close connection whereas WebSockets are designed for longer connection. You can take another look at the header, we are upgrading to TCP protocol which means we are saving a lot of resources here. How?
HTTP is not on hold (it is just being used for handshaking i.e. establishing a connection and then the connection is closed) which means we can use it for serving other short term quick requests.
Server-side is not sending no/zero payload to specify that data is not available. It is also free to serve other requests.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Glad you asked. HTTP is not meant for keeping the connection open. It is the usage that matters. HTTP is designed to serve multiple requests a quickly as possible, hence open connection -> server -> close connection whereas WebSockets are designed for longer connection. You can take another look at the header, we are upgrading to TCP protocol which means we are saving a lot of resources here. How?