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

Websockets in Github Codespaces #698

Closed
aguileraGit opened this issue Mar 16, 2023 · 2 comments · Fixed by #2125
Closed

Websockets in Github Codespaces #698

aguileraGit opened this issue Mar 16, 2023 · 2 comments · Fixed by #2125

Comments

@aguileraGit
Copy link

I've tried using Github Codespaces to run example code. Codespaces lets me install pynecone and run it. Port 3000/8000 are opened and a link is provided to the view the webpage. Keep in mind, the hostname is a custom hostname generated by Github, it obviously can't use localhost or 192.168.1.1.

However, the site is non-responsive. To make sure my code wasn't the issue, I've cloned the todo project. The website renders. If I add an item it is never added to the list. Marking off an item also has no effect.

Sure enough if I look at the Developer Tools, websockets is pointing to 'localhost' still. WebSocket connection to 'ws://localhost:8000/event/?EIO=4&transport=websocket' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Is there a config so websockets knows to use the host given by GitHub and not localhost?

@Alek99
Copy link
Contributor

Alek99 commented Mar 28, 2023

@aguileraGit Check out the mentioned issue above @simicvm may have resolved it. Lmk if that didn't work and I can take a look.

@aguileraGit
Copy link
Author

Hello @Alek99. No luck with @simicvm post.

Things I've tried...

  • Changing the api_url to the codespace url as well as the url generated for port 3000.
  • Changing the port protocol to/from http/https.
  • Looked for the nginx configuration. I couldn't find it in the normal configuration locations listed on the nginx website.

I wonder if I've made too many wild attempts and broken something that way. Or if I've chosen a wrong codespace image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants