This app is web application to measure delay time by WebSocket.
This app has two pages.
This page displays only delay time of single client. If multiple clients access this page, they can see only themselves delay time.
This page displays delay times of all clients who access this page.
This app uses WebSocket for measurement of delay time.
Client Server
| |
|-- Connect WebSocket -->|
| |
(Ts) |
|--------- Ping -------->|
|<-------- Pong ---------|
(Tr) |
| |
Delay time = Tr - Ts
Client A Server Client B
| | |
|-- Connect WebSocket -->| |
|<- [Broadcast] Connect -| |
| | |
| |<-- Connect WebSocket --|
|<- [Broadcast] Connect -|- [Broadcast] Connect ->|
| | |
Client Server
| |
|----- Delay time ------>|
| Record delay time
|<--- Delay time list ---|
| |
Client A Server Client B
| | |
| Detect disconnection |
|<-[Broadcast] Disconnect-|-[Broadcast] Disconnect->|
| | |
pip install -r requirements.txt
docker run -p 6379:6379 -d redis:5
cd pingapp
python manage.py migrate
python manage.py runserver
Access to http://127.0.0.1:8000
docker-compose build
docker-compose up -d
Access to http://127.0.0.1:8000