Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
I would like to access an HTTP Webserver that is running in my project
Using the server proxy
If your project's id is [project_id] and the service is serving on [port], and it is serving to all ip addresses (not just localhost!), then use
to access your HTTP web server.
CAVEAT: If the webserver directs the client to make additional requests to the backend for absolute URL's, e.g., the service serves a file index.html like this:
then when you click on the link, your browser will try to grab
Obviously, this can't possibly work.
Many webservers, e.g., tensorboard, work fine and do not do this. Other's won't work with modification.
Using the port proxy
This is similar to above, except you use
When you visit that URL with your web browser, your web server will get a request for
/[project_id]/port/[port]/ rather than for
/ like it does with server. Otherwise, everything is the same, including the big caveat above.
What about security?
Only collaborators on the given project can access the webserver. Our proxy server will reject all other requests. This means you don't have to worry about setting up logins/passwords on whatever webserver you run in your project. On the other hand, it means that CoCalc is not useful as a platform if you want to run a webserver that is visible to anybody in the world. If you need that, use some other service.
What about dynamically generated subdomains?
Obviously, it would be nice if we could map a project_id and port to a subdomain like
We have not implemented this.