Are there any Angular Universal examples with WebSockets?
The Serveride implementation does not know what the WebSocket object is in my case. And if I use socket.io, the node server freezes when trying to make connections.
Additional information about the problem:
I downloaded angular -universal-starter from github: https://github.com/angular/universal-starter
which works just fine from the box running "npm install" and "npm start"
But after I added the following code to the AppComponent
export class AppComponent implements OnInit {
ngOnInit() {
let webSocket = new WebSocket("----server url----")
}
}
I got the following error on the NodeJs server console:
EXCEPTION: WebSocket is not defined
ORIGINAL STACKTRACE:
ReferenceError: WebSocket is not defined
at AppComponent.ngOnInit (/Volumes/Development/cacadu/website/universal-starter-master2/dist
/server/index.js:41725:29)
Marco source
share