Hi I have two instances for ec2. One is for socket io and one is for my api requests. Both running with nginx.
I can access my socket io server in the browser. But I can not listen to it in my api server with this code in my api server:
var io = require('surespot-socket.io');
var http = require('http');
var server = http.createServer();
server.listen(socketPort, config.socket.host);
var socket = io.listen(server);
config.socket.host is the host name of the server while socketPort is the port of the socket.
I am always getting this error from my api server:
warn - error raised: Error: listen EADDRNOTAVAIL
Kindly help me. :(