DVLP / signalr-no-jquery

120 stars 78 forks source link

Error in connecting via WebSocket #32

Closed suraj18 closed 5 years ago

suraj18 commented 7 years ago

Hi, I' m facing issue :Error during WebSocket handshake: Unexpected response code: 400 while connecting to Hub. And again it fall down to serverSentEvents and works fine. What could be the reason with transport :WebSocket

misumi111 commented 6 years ago

Hi,I have the same problem. I find it is on line 748 and 754 in src/signalR.js.

        if ($.inArray(transport, supportedTransports) >= 0) {
        } else if ($.inArray(config.transport, supportedTransports) >= 0) {

$.inArray is from jQueryShim.js

    inArray: (arr,item) => arr.indexOf(item) !== -1

This is return Boolean. So I resolve this problem.

        if ($.inArray(supportedTransports, transport)) {
        } else if ($.inArray(supportedTransports, config.transport)) {
dcyuksel commented 6 years ago

still having this issue

tubalmartin commented 6 years ago

@misumi111 make a PR please with the fixes