Discussion:
Do WebSockets use HTTP?
(too old to reply)
b***@hotmail.com
2016-04-05 18:58:59 UTC
Permalink
I thought WebSockets (in Javascript) were the same thing as sockets in a C program, but are they? Or do they go over HTTP? Is it possible in them, to open a connection to the server on a NON-80 port?


Thanks.
Robert Wessel
2016-04-05 20:26:00 UTC
Permalink
Post by b***@hotmail.com
I thought WebSockets (in Javascript) were the same thing as sockets in a C program, but are they?
No. But once you're connected to the server application, it's pretty
similar though.
Post by b***@hotmail.com
Or do they go over HTTP? Is it possible in them, to open a connection to the server on a NON-80 port?
They start as a HTTP request, and then (approximately) convert that to
something like a TCP connection. The equivalent of using the
destination port to select the host application to connect to is
handled by a parameter in the HTTP header. The default is port 80,
but only for the same reasons that the default HTTP port is 80.

Continue reading on narkive:
Loading...