Websocket, Angular 2 and JSON Web token Authentication
问题 My Angular 2 app (coded in typescript) has a simple authentication scheme: User logs in: Server returns JSON Web Token (JWT) abc123... On every API call, the app sends the JWT in the Authorization header Server validates the JWT and grants access Now I'd like to add websockets. I'm wondering how to authenticate the user there. Since I don't control which headers are sent to the websocket server (WS), I cannot send the JWT. My idea so far (not yet implemented): Client opens websocket: let sock