This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import random | |
| import time | |
| from contextlib import asynccontextmanager | |
| from fastapi import FastAPI, WebSocket, WebSocketDisconnect | |
| from fastapi.responses import HTMLResponse | |
| # Store connected WebSocket clients globally | |
| connected_clients = [] | |
| # Task references to properly manage background tasks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>EastMoney K-line Picture Viewer</title> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; | |
| margin: 2em; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .PHONY: venv install run clean | |
| # Create virtual environment | |
| venv: | |
| python3 -m venv .venv | |
| # Install dependencies | |
| install: venv | |
| . .venv/bin/activate && pip install fastapi "uvicorn[standard]" pydantic |
OlderNewer