I'm using WebSocket in order to send data from chrome extension to local Java application.
The JS code in the chrome application is :
ws.onopen = function() {
alert("Opened!");
ws.send("Hello Server");
};
ws.onmessage = function (evt) {
alert("Message: " + evt.data);
};
ws.onclose = function() {
alert("Closed!");
};
ws.onerror = function(err) {
alert("Error: " + err);
};
The problem comes up when no connection is ever made .I've tested the server side by simply running the JS code above , with no connection to any Chrome extension, simply through Chrome browser, and it has worked just fine.
I'd like to know why I cannot create WebSocket connection from Chrome addon, and I'd be grateful if anyone could point me to the solution.
Thanks in advance.