Bubbler
September 24, 2019, 11:16pm
2
Basically, in order to run two different web servers, you need to use two different ports.
Glitch only opens port 3000 for the project container, but you might be able to get different internal ports running via reverse proxy. (No actual example found though, so it can be harder than it sounds.)
@geoffrey1900 things are a little more complicated than what @charliea21 describes, but the essence is correct. There are a few layers that a request to a specific Glitch url goes through, but basically a request comes in for port 80 or 443 (depending on whether HTTP or HTTPS) and it gets forwarded through our infrastructure and eventually ends up at port 3000 (usually) in your project’s container. We do only open a single port, but you could try something like what’s discussed in What's the por…
Right now we only expose only one port to the external world. If you want to expose more than one service, you might try with a reverse proxy, like the one offered by the http-proxy npm package. That way, you might have different services listening at various port, and then the proxy listening at port 3000: the proxy might then convert different urls into different ports, for example:
https://your-project.glitch.me/serviceA/:path -> http://localhost:4000/:path
https://your-project.glitch.me/ser…
1 Like