WebSocket connection failed: Error during WebSocket handshake: Unexpected response code: 400

后端 未结 16 1442
攒了一身酷
攒了一身酷 2020-12-04 21:08

I am trying to integrate Socket.io with Angular and I\'m having difficulties making a connection from the client-side to the server. I\'ve looked through other related quest

16条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-04 21:50

    I solved this by changing transports from 'websocket' to 'polling'

       var socket = io.connect('xxx.xxx.xxx.xxx:8000', {
          transports: ['polling']
       });
    

提交回复
热议问题