cordova-plugin-socket-scrutinizer
v0.0.0
Published
Cordova socket connection plugin that enable an application to create a communication on a given port and receive data on that given port.
Downloads
4
Maintainers
Readme
cordova-plugin-socket-scrutinizer
=========
A small library providing utility methods to create
a socket connection , listen
to a given port and receive
all data to that given port.
Constraint
*The data sent to that given port must be of type string and the plugin will return it as a JSON string.It must be parse back to JSON. *Support only android.
Installation
cordova plugin add cordova-plugin-socket-scrutinizer
Usage
In the index.html include :
<script src="SocketConnection.js"></script>
below the cordova.js script.
var port = 3000; // desired port to listen to
SocketConnection.scrutinize("listen", port, function (data) {
//onReceive data callback
var dataFromSocket = JSON.parse(data.response);
console.log(data.response);
};
Release History
- 0.0.0 Initial release