Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codespace Websocket Support #797

Closed
cpietsch opened this issue Sep 11, 2020 · 1 comment
Closed

Codespace Websocket Support #797

cpietsch opened this issue Sep 11, 2020 · 1 comment

Comments

@cpietsch
Copy link

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.

@underfin
Copy link
Member

Duplicated of #652

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants