WebSocket connection to 'ws://..' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
Pulling my hair searching from last 4 hours this simple code for socket connection and getting error. I have changed port as well but nothing works. //create a new WebSocket object. var wsUri = "ws://localhost:9000/demo/server.php"; websocket = new WebSocket(wsUri); websocket.onopen = function(ev) { // connection is open $('#message_box').append("<div class=\"system_msg\">Connected!</div>"); //notify user } $('#send-btn').click(function(){ //use clicks message send button var mymessage = $('#message').val(); //get message text var myname = $('#name').val(); //get user name if(myname == ""){ //
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.