Node.js with Socket.io - Long Polling fails and throws “code”:1,“message”:“Session ID unknown” response

前端 未结 5 1594
南笙
南笙 2021-01-04 02:43

I\'m stuck on why a node.js app that was moved to an IIS7 server is now failing. I know IIS7 doesn\'t support web sockets but my understanding was that socket.io would fall

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-04 03:05

    In my project, I tried adding the transport option as a websocket and error no longer appears.

    io.connect(url, {
       "transports": ['websocket']
    })
    

    It will be a problem with supporting IE and other old browsers as they don't support native websockets, if the application browser compatibility is not an issue this seems a solution.

提交回复
热议问题