## 🔐 Login

Email:
Password:

## 📋 Token Info

No token yet. Login first.

## 📡 WebSocket Connection

Disconnected

WebSocket URL:

## 🏓 Ping/Pong Test

Test connection heartbeat:

0
Pings Sent
0
Pongs Received
--
Latency (ms)

## 📨 WebSocket Messages Log

## 🚨 Create SOS Alert

Alert Type:
Latitude:
Longitude:
Address:
Message: 🚨 WebSocket Test SOS Alert

## 📍 Location Info

Location will be shown here

## 📊 Recent Alerts

No alerts created yet

### 🟢 Connection Status

OFF

### 📨 Messages Received

0

### ⏱️ Uptime

0s

### 📈 Performance Metrics

Avg Latency: | --
Max Latency: | --
Min Latency: | --
Success Rate: | --

### 🧪 Auto Test

Run automated tests every 30 seconds:

## 📊 System Statistics

Waiting for data...

## 📖 How to Test WebSocket SOS Service

### 1. 🔐 Step 1: Authenticate

1. Go to Authentication tab
2. Enter credentials (default: wstester@test.com / WsTest1234!)
3. Click Login
4. You should see a JWT token in the Token Info panel

### 2. 📡 Step 2: Connect WebSocket

1. Go to WebSocket tab
2. Click Connect button
3. You should see connection status change to "Connected"
4. Green indicator means WebSocket is active

### 3. 🏓 Step 3: Test Ping/Pong

1. Click Send Ping button
2. Watch for pong response in the message log
3. Latency should be < 100ms

### 4. 🚨 Step 4: Create SOS Alert

1. Go to SOS Alert tab
2. Fill in location (latitude/longitude)
3. Enter message
4. Click Create SOS Alert
5. Check WebSocket Messages Log for alert notification

### 5. 📊 Step 5: Monitor Results

1. Go to Monitor tab
2. View connection status, message count, and uptime
3. Check performance metrics (latency, success rate)

ℹ️
Default Test Credentials:
Email: `wstester@test.com`
Password: `WsTest1234!`

### 🔧 API Endpoints

POST /api/v1/auth/login Content-Type: application/json { "email": "wstester@test.com", "password": "WsTest1234!" }
WebSocket: ws://localhost:8002/api/v1/emergency/ws/{user_id}?token={jwt_token}
POST /api/v1/alert Authorization: Bearer {jwt_token} Content-Type: application/json { "latitude": 55.7558, "longitude": 37.6173, "address": "Location", "alert_type": "SOS", "message": "Emergency message" }

### 💡 Tips

- Keep WebSocket connected while testing SOS alerts
- Messages appear in real-time in the WebSocket Messages Log
- Green indicator = Connection is active
- Red indicator = Connection is lost
- Latency < 100ms is excellent
- Use Monitor tab to track performance