feat: update WebSocket connection and add system version sending functionality

- Changed WebSocket connection URL to localhost for testing.
- Added a function to send system version to the server upon connection and after a delay.
- Improved logging for received messages.

chore: update package dependencies

- Bump versions for several dependencies including @kevisual/query, lucide-react, vue, and others.
- Update package manager version to pnpm@10.26.1.

fix: adjust app initialization to use sessionStorage

- Modified the app initialization to use a custom sessionStorage implementation backed by an LRU cache.

feat: implement sessionStorage with LRU cache

- Added a new module for sessionStorage that utilizes LRUCache for efficient caching.
This commit is contained in:
2025-12-21 04:20:25 +08:00
parent b3c5e7d68d
commit 36628c8279
16 changed files with 323 additions and 112 deletions

View File

@@ -5,11 +5,20 @@ const testRouter = () => {
// const ws = new WebSocket('wss://kevisual.xiongxiao.me/ws/proxy');
// const ws = new WebSocket('wss://kevisual.xiongxiao.me/api/router');
const ws = new WebSocket('ws://118.196.32.29:3005/api/router');
// const ws = new WebSocket('ws://118.196.32.29:3005/api/router');
// const ws = new WebSocket('wss://kevisual.cn/api/router');
const ws = new WebSocket('ws://localhost:51015/api/ws/demo?id=12345');
console.log('Connecting to WebSocket server...');
ws.on('open', () => {
console.log('WebSocket connection opened');
sendSystemVersion();
setTimeout(() => {
sendSystemVersion();
console.log('第二次发送');
}, 3000);
});
const sendSystemVersion = () => {
ws.send(
JSON.stringify({
"type": "router",
@@ -19,10 +28,10 @@ const testRouter = () => {
}
}),
);
});
}
ws.on('message', (data) => {
console.log('Received message from server:', data.toString());
console.log('Received message from server e:', data.toString());
});
ws.on('close', () => {
console.log('WebSocket connection closed');