Skip to content

Instantly share code, notes, and snippets.

@paulodiniz
Created September 10, 2020 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulodiniz/23e17a0bcad670dfb778b4b2addaa47e to your computer and use it in GitHub Desktop.
Save paulodiniz/23e17a0bcad670dfb778b4b2addaa47e to your computer and use it in GitHub Desktop.
# Reverse Proxy
This document provides the basis for build the Airy Reverse Proxy.
## Vision
We want to give our core users the ability spawn a basic version of the Airy plataform with one (or a few amount) of simple commands. One aspect of this is that we need to provide a way of a source (Facebook) to be able to send messages to the local ran platform. This should be invisible to the user, with none or only a few basic configuration steps before running it.
To achieve this, we need to build a reverse proxy that sits between the source and the local cluster. The reverse proxy will receive events from the source and forward it to the local cluster on a specific endpoint and port.
## Requirements
- Little or no configuration
- Will provide a URL http://\<identifier\>.tunnel.airy.co/
- Users should be able to use indepentely of the platform (?)
## Architecture
<!-- language: lang-none -->
+--------------+ +-----------------+ +----------------------+
| | | | | |
| Facebook +-----------> hosts.airy.co +--------->+ Local cluster |
| | | | | |
+--------------+ +-----------------+ +----------------------+
### Usage
The user of the reverse proxy should be able to start the proxy with one command.
```
./airy-proxy
```
This will yield a URL in the format of `http://<identifier>.tunnel.airy.co`. Keep in mind that for now, the identifier is not stable and will change every time.
hosts.airy.co
- receives a request from facebook to 123.hosts.airy.co
- checks a inner map to get the ssh connection
- forward the request body to the ssh tunnel
###
- Create a secure SSH tunnel
- Foward requests from port 80 to
The first is to create a secure connection between the local machine and the server runnning on `tunnel.airy.co`. We can achieve that by creating a secure SSH tunnel between both ends using the private key on the local machine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment