Expose Public Port

I’d love to use codespaces in a semi public setting (live streams, workshops, etc). I’m wondering if there’s a way to expose a port publicly to allow people to get a live preview.

Hey! This isn’t currently possible, but it’s on our backlog to support this. So we can use this topic to track progress :+1:

That said, if you’re interested in enabling collaboration with your viewers, you could also checkout using Live Share for that? That extension is pre-installed in Codespaces, and would allow viewers to join in with you (you could make the code read-only), and be able to browse the running application as well (since Live Share allows sharing servers with “guests”).

We see quite a few live streamers using this for engaging their audience, and so I just wanted to check if that might be helpful for you as well. Let us know!

FYI @plisy

I built a codespace for doing some documentation with mkdocs.
This means serving up a localhost static website to preview changes isn’t possible in Codespaces, correct?

For web development debugging, this seems problematic. Are there any work arounds or should I stick with local docker for anything creating a localhost web server to preview contents?

@sheldonhull, serving up and viewing websites in a Codespace is absolutely supported. The distinction is that only you can access your Codespaces, and similarly, only you can access the forwarded ports / websites in your Codespace. You can’t share the link to your website with a friend/client today since they are not public, but you can access them to view and test your websites, or preview static docs changes in your case.

The ability to make a port public is on the roadmap, although the default will likely always be to start with them being private since that’s a more secure default.

Very cool. Thanks for correcting that.
Is this the correct instructions to follow then: Developing In a Codespace - Forwarding Ports?

Yep, those are the right docs! Let us know if you hit any issues when trying it out.

Does port forwarding work on an iPad? I can’t get it to work.

It may be you’re hitting the issue where links aren’t clickable. We’re working to solve that without a small workaround but this should work in the meantime: iPadOS: server URL isn’t pasted & unable to be clicked