btford / angular-socket-io

Socket.IO component for AngularJS
1.51k stars 233 forks source link

Define transports in my socket.io #140

Closed masalinas closed 8 years ago

masalinas commented 8 years ago

How can use your controler and define my socket.io like this:

var socket = io({transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling', 'polling']});

Can I configure the socketFactory like this??? :

socketFactory({transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling', 'polling']}); ???

masalinas commented 8 years ago

I resolve the problem defining my socketfactory like this:

$provide.factory('Socket', function (socketFactory, Context) {
            //return socketFactory();
            var socket = io({transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling', 'polling']});

            return socketFactory({ioSocket: socket});
        });