mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
guh
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>webui</title>
|
||||
<script type="module" crossorigin src="/assets/index-BED_cmF2.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-ERyMYA6S.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DoNH_msu.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
+5
-13
@@ -1,15 +1,7 @@
|
||||
import { io } from 'socket.io-client';
|
||||
|
||||
const configuredUrl = import.meta.env.VITE_ROVERD_URL?.trim();
|
||||
const serverUrl = configuredUrl && configuredUrl.length > 0 ? configuredUrl : undefined;
|
||||
|
||||
export const socket = io(serverUrl, {
|
||||
transports: ['websocket', 'polling'],
|
||||
timeout: 15000,
|
||||
reconnectionAttempts: 5,
|
||||
query: { role: 'user' },
|
||||
});
|
||||
|
||||
socket.on('connect_error', (error) => {
|
||||
console.error('Socket connection error:', error.message);
|
||||
});
|
||||
const configured = import.meta.env.VITE_ROVERD_URL?.trim();
|
||||
const resolvedUrl = configured && configured.length > 0 ? configured : window.location.origin;
|
||||
console.info("[socket] connecting to", resolvedUrl);
|
||||
export const socket = io(resolvedUrl, { transports: ["websocket","polling"], timeout: 15000 });
|
||||
socket.on("connect_error", (err) => console.error("connect_error", err.code, err.message, err.data));
|
||||
|
||||
Reference in New Issue
Block a user