Secure Webscoket Connection using wss is never established
-
03-06-2022 - |
سؤال
i want to build an architecture with wss, i implement my certificates and they work. But now, when i'm connect on the browser, my program create websocket and close it directly, i don't understand why, this is my code which is running at port 5005
window.onload=function(){
if (!window.WebSocket) {
window.WebSocket = window.MozWebSocket;
}
if (window.WebSocket) {
socket = new WebSocket("wss://localhost:7575/websocket");
socket.onopen = function(){
alert("opened the connection");
socket.send("Hello");
};
socket.onmessage = function(message){
var json = jQuery.parseJSON(message.data);
notifyApplication(json);
};
socket.onclose=function(){
alert("Websocket coonection is closed");
};
}
else {
alert("Your browser doesn't support websocket");
}
};
and the webscoket server is implemented using netty and it is running at the port 7575. which offers an SSL3.0 enabled https connection.
لا يوجد حل صحيح
لا تنتمي إلى StackOverflow