It is necessary to transfer the message from the computer, there the client on NodeJS (at me). Recipient, Android client on javascript (cordova). I try to transfer using sockets.
NodeJS server code:
var io = require('socket.io').listen(8080); io.sockets.on('connection', function (socket) { socket.send("Test_Message"); }); Client code:
var socket = io.connect('http://localhost:8080'); socket.on('connect', function() { socket.on('message', function(msg) { var di = document.getElementById("subscribe").innerHTML = msg + " "; }); }); When emulated in a browser (cordova run browser) - works. Emulation of the application on the computer and launch on the device do not give anything.
Maybe in the address you need to write not localhost?