signalr not working on specific isp networks

試著忘記壹切 提交于 2019-12-05 01:09:52

Okay its been so long and I was hoping to get help by now, but never mind I mannaged it.

First:

The guys at signalr's channel in Jabbr suggested me to try surfing the website using SSL in hopes it would solve the problem. I'm afraid I did not have the chance to check that :( But in case any of you meets the same issue and gets to use SSL approach to solve it, I would deffinitly love to here about it!

And to my answer:

I am taking the user IP and testing if it's in any of the problematic ISP subnets. If it is, I'm passing my view a parameter, lets say: bool disableWebsockets = True/False; If its true, I'm passing signalr a list of transport protocols that does not include websockets. If false - the list does include websockets.

That's it.

function signalrTransportList(wsState) {
    if (disableWebsockets == "False") {
        var list = ['webSockets', 'serverSentEvents', 'longPolling', 'foreverFrame'];
    }
    else {
        var list = ['serverSentEvents', 'longPolling', 'foreverFrame'];
    }

    return list;
}

...
...

$.connection.hub.start({ transport: signalrTransportList(wsTransport) })
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!