SignalR: getting error: WebSocket closed RRS feed

  • Question

  • User-266573780 posted

    I am working on project of Ionic with angular and AspNet with SignalR that have chat module.
    I use SignalR for Chat.It's working smoothly but some time i am getting error as per below screen shot and because of that it's get stop working at all.
    I have hosted my service on IIS and creating proxy and communicating with client and server. Here is sample

      (function () {
                  .factory('SignalRFactory', SignalRFactory);
                SignalRFactory.$inject = ['$rootScope', 'Hub', 'ionicToast'];
                function SignalRFactory($rootScope, Hub, ionicToast) {
                    var signalRLocal = this;
                    var serverURL = 'https://serivcerURL.com/signalr';
                    //Hub setup
                    var hub = new Hub('CommunicationHub', {
                        rootPath: serverURL,
                        listeners: {
                            'send': function (data) {
                                console.log("send " + data);
                        errorHandler: function (error) {
                        //Here i am getting that websocket closed error
                    signalRLocal.Connect = function (user) {
                        console.log("SignalR Connecting as :" + user.UserName);
                        hub.invoke('connect', user);
                    return signalRLocal;


    I have hosted service on IIS. I search for the solution and find something like this https://stackoverflow.com/questions/31011288/signalr-2-2-0-websocket-error-connecting-to-hub

    I also try with above link solution by using "long Polling" as per below

    Hub.connection.start({ transport: 'longPolling' });

    But i don't want to use "long Polling" at all. So can someone help me to figure out this issue without use of 'long Polling'. Can someone tell me what configuration i have to do at client side or at IIS level.

    Friday, July 28, 2017 6:16 AM

All replies