Skip to content

spacecraft-repl/proxy-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reverse Proxy for SpaceCraft

A reverse proxy acts as a middleware that sits between our clients and our server which serves as an intermediary between the two. The benefit is that we can abstract away the connection of addresses and ports to ensure the privacy of our sessions. From the client’s perspective, they are connected to the appropriate container and don’t know the exact IP address or port number of the container or our host system.

Furthermore, our proxy server can assign random URLs to created sessions, thereby preventing other unwanted users from gaining access to a current session through port sniffing or guessing pre-determined URLs.

Our proxy server is now serving requests through HTTPS connections established through Let's Encrypt certificates.

https://repl.space

Session Management

To connect different groups of users to different sessions, our reverse proxy server is also responsible for:

  • initializing a session within a new container
  • forwarding requests to the appropriate container
  • destroying a session and it’s container

In order to customize a reverse proxy to fit our use case, we built our reverse proxy from scratch using Node.js, node-http-proxy and Dockerode.

Case Study

To read more about how we handle a reverse proxy and manage multiple sessions, check out our reverse proxy section in our case study.