Overview
ThePassengerWsService handles real-time WebSocket communication using Socket.io. It connects passengers to the backend to receive live trip updates, driver assignments, and status changes.
Location: src/app/core/services/socket/passenger-ws.service.ts
Namespace: /passengers
Configuration
Connection Setup
Methods
connect()
Establishes WebSocket connection to the server.- Prevents duplicate connections (checks if already connected)
- Automatically includes access token from
AuthStore - Refreshes token on reconnection attempts
- Sets up all event listeners
- Logs all incoming events for debugging