I get a status 200 when connecting to the websocket, but it is an error?

后端 未结 6 1415
名媛妹妹
名媛妹妹 2020-12-02 22:54

My error shows up in the console of my browser:

\"WebSocket connection to \'ws://localhost:32768/DspClusterWebServices/myHandler\' failed: Unexpected response

6条回答
  •  星月不相逢
    2020-12-02 23:14

    Please check http://procbits.com/connecting-to-a-sockjs-server-from-native-html5-websocket!

    After you append /websocket (to your URL), it will give you the error

    Failed to parse Origin header value [null]

    ;) , which then will in turn lead you to that link.

    You'll have to add .setAllowedOrigins("*") to your addHandler() method, and then it could finally work!

提交回复
热议问题