I have been using GlassFish server, where, index.html is sending the control to servlet file which is sending the control to another nextStep.html file, which is working on WebSockets. Right now, I am confused, as I am getting an error:
WebSocket connection to 'LocalHost-link' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
I think this problem is related to port numbers. Can we use both WebSockets and HTTP server on the same port, if yes, then How ? If we have to use different ports, then how to perform this task in Java ?
To provide this question with an answer: Yes, they can.
See also: