I'd like to write a Firefox OS app that allows me to initiate various
activities -- sending an SMS, for example -- from a remote device like a
desktop computer.
It would seem that navigator.mozTCPSocket might allow me to listen for incoming
requests on a given port and to react to them.
I'd like to understand first if I'm understanding the capabilities of this API
correct.
For example, if I run an app with code like this on my device:
var socket = navigator.mozTCPSocket.open('localhost', 8080);
socket.ondata = function (event) {
if (typeof event.data === 'string') {
console.log('Get a string: ' + event.data);
} else {
console.log('Get a Uint8Array');
}
}
Should I then expect to be able to do something like:
echo "Hello" | netcat [device IP] 8080
and see "Hello" in the console log of the device?
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g