I am Trying this Socket.IO in my Application https://github.com/nkzawa/socket.io-android-chat
I am connecting the socket with
mSocket = IO.socket(ip:XXXX);
It is throwing EVENT_CONNECT_ERROR listener, i connect my applcation
using my computer as a local server.
here is my node js code:
var http = require('http');
var server = http.createServer(function (req,res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World');
});
server.on('listening',function(){
console.log('ok, server is running');
});
server.listen(3000);
console.log('yes connected');
In chrome I use this to check
chrome://inspect/#devices
Click on PortForwarding . Use Port: 8080 IPAddress and Port:localhost:8080
On your phone ( must be connected via USB to your computer) , go to the address in your phone's chrome browser. Sometimes you need to refresh before your phone can use your localhost.