-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Description
It would be great to have vite running in a github codespace container.
Right now it works, but without Websockets because of the port forwarding.
Codespace will forward eg. port 3000 to an xxxx.apps.codespaces.githubusercontent.com (port 80).
Vite tries to connect to the port which is a global constant and is different then the proxied port.
console.log('[vite] connecting...');
const socketProtocol = location.protocol === 'https:' ? 'wss' : 'ws';
const socketUrl = `${socketProtocol}://${location.hostname}:${3000}`;
const socket = new WebSocket(socketUrl, 'vite-hmr');When serverd via the codespace server proxy, port 80 is mapped to 3000 internally. So we would need to adjust the port accordingly when using codespace.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels