It is possible having a wss protocol over http ? i've read on a forum that ws work with http, but wss works only with https ? Is that true ?
Cause i'm trying to test it on my wamp on localhost, but not working
It is possible having a wss protocol over http ? i've read on a forum that ws work with http, but wss works only with https ? Is that true ?
Cause i'm trying to test it on my wamp on localhost, but not working
ws
tells a WebSocket client library to usehttp
to connect to a WebSocket server. Likewise,wss
tells a WebSocket client library to usehttps
to connect to a WebSocket server. Just that. "ws protocol" and "wss protocol" are strange words. "WebSocket protocol" is the right word. WebSocket protocol can be used over both plain HTTP connections (http
) and secure HTTP connections (https
).Note that communication between a WebSocket client and a WebSocket server starts as a normal HTTP protocol. To start WebSocket communication, a WebSocket client sends a request like below to a WebSocket server (This is an excerpt from RFC 6455, 1.2. Protocol Overview).
As you can see, this is a normal HTTP
GET
request. A WebSocket server can wait for this kind of requests on an unsecured port (http
, 80 is the default) or on a secured port (https
, 443 is the default). It's up to WebSocket servers.If a WebSocket server you are using is waiting for requests on an unsecured port, pass
ws
to a WebSocket client library you are using. Otherwise, if the WebSocket server is waiting for requests on a secured port, passwss
to the WebSocket client library.Some implementations of WebSocket client libraries accept not only
ws
andwss
but alsohttp
andhttps
just for developers' convenience."WSS on http" is a strange word. On the other hand, "WebSocket protocol on http" and "WebSocket protocol on https" make sense.