I'm new to websockets and i'm simply trying to get the server to respond when opening my app in the browser, but the connection.onopen
is not responding as expected. Thanks for any help you can provide.
angular.module('app')
.run(function ($rootScope) {
var url = 'ws://localhost:3000'
var connection = new WebSocket(url)
connection.onopen = function () {
console.log('WebSocket connected')
}
})