79117092

Date: 2024-10-23 08:41:56
Score: 1
Natty:
Report link

You are using socket.io on server side, but seems you are not using socket.io on the client side in your code. I think That 's why your code works with your html file but not in this java client code.

As explained in the "What Socket.IO is not" section, the Socket.IO client is not a WebSocket implementation and thus will not be able to establish a connection with a WebSocket server, even with transports: ["websocket"]:

https://socket.io/docs/v4/troubleshooting-connection-issues/#you-are-trying-to-reach-a-plain-websocket-server

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: vrobbi