I'm using NGINX to handle my Nodejs servers and now I want to start using socket.io on them, doing research before starting to play with socket.io i found Sailsjs which I grew rather found of and now currently using.
The problem I meet though, is that the client can't connect through NGINX on socket.io, or sails.io.
This is the URL path for my current APP: https://localhost/economy
And the url for sails.io is, as standard: https://localhost/economy/assets/js/dependencies/sails.io.js
Now! Using FileSeek I found out where sails.js use "require("socket.io")", which is in the "loadSocketIO.js" (node_modules\sails\lib\hooks\sockets\lib). I edited the file to say:
var io = sails.io = sails.ws =
SocketServer.listen(sails.hooks.http.server, {
resource: 'economy',
logger: {
info: function (){}
}
});
adding the resource: 'economy', line. Then on the client side I did the same:
var socket = io.connect('https://localhost/economy/socket.io', { resource: 'economy' });
I've been playing with this and tried different ways, like "economy/socket.io", the full socket.io path etc.
Any help, is a lot of help!
I've been struggling for a day now so I figured i'd ask for some help :)