I am using this cordova plugin : https://github.com/HeimgardTechnologiesAS/cordova-plugin-advanced-websocket#readme android platform 8.1.0 but can not get work this is js code :
document.addEventListener('deviceready', function () {
var wsOptions = {
url: "ws://192.168.0.18:4233",
timeout: 5000,
pingInterval: 10000,
acceptAllCerts: false
}
CordovaWebsocketPlugin.wsConnect(wsOptions,
function (recvEvent) {
alert("Received callback from WebSocket: " + recvEvent["callbackMethod"]);
},
function (success) {
alert("Connected to WebSocket with id: " + success.webSocketId);
},
function (error) {
alert("Failed to connect to WebSocket: " +
"code: " + error["code"] +
", reason: " + error["reason"] +
", exception: " + error["exception"]);
}
);
}, false);
I got this error : Failed to connect to Websocket: code: 1006, reason: undefiened, exception: CLEARTEXT communication to 192.168.0.18 not permitted by network security policy