K
K
Konstantin Chuykov2015-06-01 07:35:38
Node.js
Konstantin Chuykov, 2015-06-01 07:35:38

What does socket.io bind to?

Hello! There is a local project on port 3000, on which sockets exchange client-server data. Now such a moment, I open the address of the project in Google Chrome, the data has been transferred, everything is fine. I open it in Safari, the same effect, the same data was transferred. I open from an iPhone at the local address 192.168.1.*:3000 there is no data. And this result seems to suit me, because this is authorization data, and in theory they should be assigned to the browser, but I have a feeling that they are assigned to the ip-shnik, and not to the browser. How should it work correctly?
Here is the server and client source:

var app = angular.module('selfMade');
app.controller('MainController', ['$rootScope', '$scope', 'socket', function ($rootScope, $scope,  socket) {
    socket.on('auth',function(data){
        $rootScope.auth = data;
    });
  }
}]);

module.exports = function (app) {
    var io = app.get('socket');
    passport.use('vk', new vk(vk_conf, function (accessToken, refreshToken, params, profile, done) {
            io.on('connection', function(socket) {
                socket.emit('auth', profile);
            });
    }));
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pomeo, 2015-06-01
@pomeo

You are talking about the session, it seems that the session is assigned to the domain, in this case your domain is ip.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question