mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-05 01:11:32 +02:00
Local serving optimizations and Windows docs updates
This commit is contained in:
@@ -49,11 +49,7 @@ export function useWebSocket(options: UseWebSocketOptions) {
|
||||
const connect = useCallback(() => {
|
||||
// Determine WebSocket URL based on current location
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
// In development, connect directly to backend; in production, use same host
|
||||
const isDev = window.location.port === '5173';
|
||||
const wsUrl = isDev
|
||||
? `ws://localhost:8000/api/ws`
|
||||
: `${protocol}//${window.location.host}/api/ws`;
|
||||
const wsUrl = `${protocol}//${window.location.host}/api/ws`;
|
||||
|
||||
const ws = new WebSocket(wsUrl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user