Working with WebSockets in Angular apps
summary
Explains how an Angular app connects to a Node.js WebSocket server using the npm ws package and TypeScript, shows code for wrapping the browser WebSocket in an Angular service and for using rxjs’s WebSocketSubject, cites a quoted latency drop (≈150ms to ≈50ms) and two-byte frame overhead, and demos an online-auction app where bids propagate instantly between browsers. Shows server handshake (HTTP 101 upgrade), ng serve build steps, and claims scalable single-socket loads (tens of thousands) working end to end.
AI-written summary · about
chapters (8)
- 0:00Introduction to WebSockets
- 1:35Benefits of WebSockets
- 4:47Implementing a simple server
- 8:05Browser and server interaction
- 12:25Angular WebSocket service
- 24:16Using RxJS WebSocket subject
- 29:01Auction app demonstration
- 35:01Messaging systems and wrap-up
related talks
23mRxJS, Angular, and WebSockets - The Spy Life
41mDeep Dive into RxJS WebSocket Subject
01h 28mIntroduction to WebSockets
37mAngular 2 and WebSockets
47mA deep dive into RxJS WebSocket Subject
46mEvent-Driven UX in the Real World with Angular and Socket.io
47mThe Greatest Mystery is Realtime with Angular, NestJS, and websockets!
40mSocket to me
