https://github.com/la3rence/websocket-cluster-front
WebSocket 集群效果展示,React 前端
https://github.com/la3rence/websocket-cluster-front
react websocket
Last synced: about 1 year ago
JSON representation
WebSocket 集群效果展示,React 前端
- Host: GitHub
- URL: https://github.com/la3rence/websocket-cluster-front
- Owner: la3rence
- Created: 2021-03-25T03:53:16.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-10T23:46:28.000Z (about 1 year ago)
- Last Synced: 2025-04-11T00:28:21.228Z (about 1 year ago)
- Topics: react, websocket
- Language: JavaScript
- Homepage: https://go.lawrenceli.me/ws
- Size: 1.32 MB
- Stars: 12
- Watchers: 1
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo front-end project for WebSocket cluster
此项目为[实战 Spring Cloud 的 WebSocket 集群](https://github.com/Lonor/websocket-cluster)的前端页面。
## 本地运行
新建 `.env.development.local` 文件,添加相关环境变量:
```
REACT_APP_REST_URL=http://127.0.0.1
REACT_APP_WS_URL=ws://127.0.0.1
```
启动项目
```
yarn
yarn start
```
访问 `http://localhost:3000` 即可查看效果。
## React Hooks
组件中以 `_hook` 结尾的 js 是使用了 React Hooks 重构。原始的 Class 式组件均保留而未使用。
## 效果图
WebSocket servers or clients status:
- `#ffff00` Unhealthy (being started / shut down)
- `#0cb00c` Healthy (available for accepting request)
- `#ff0102` Down (disconncted)
