WebSocket handshake: Unexpected response code: 404

后端 未结 4 1569
予麋鹿
予麋鹿 2021-02-19 06:07

Am writing my first websocket program and am getting \"WebSocket handshake: Unexpected response code: 404\", error while loading the webpage.

I am using

4条回答
  •  面向向阳花
    2021-02-19 06:41

    Actually, the problem here is case-sensitivity in the URLs. You did not need to change the project name. Just changing the Websocket URL in JavaScript file to

    ws://localhost:8080/WebSocketHome/actions 
    

    (with capital S, as in the project name) would have solved the problem. In your case, changing both of them removed the case inconsistency, so it worked.

提交回复
热议问题