Tiny Reverse Proxy, built in Asynchronous Python.
- Simple Configuration
- Low Runtime Footprint (Highly debatable, however)
- Fully asynchronous operations
- Insanely easy route setup
This has not been tested as thoroughly as it should've been. It is also very much not finished! While in theory, it may seem fairly safe to be thrown into the harsh winds of the internet, in practice, I would imagine any experienced bad actor could find some sort of crack in the url system.
Spotted something I could improve? Leave an issue!
Firstly, on boot, a file named 'settings.tiny' is read from. It's called .tiny, because it's fairly small.
Example settings.tiny:
# Routes + Options File for TinyRP v1.0.0
# Routes begin with >, Settings begin with -.
- port -> 8000
- host -> 0.0.0.0
> http://localhost:8000 -> 127.0.0.1:5500
Comments can be created using # or /. As the file says, routes begin with > and settings begin with -. It follows a fairly simple 'structure' wherein, quite simply, 'key -> value'.
After the settings and routes are registered, the Quart-Uvicorn ASGI server starts. It runs a route on / and /<path:page>.
When a user sends a request, the server checks if their host is inside the routes dictionary, and resolves it to a url. From there, it uses aiohttp to get the url using the exact(ish) same details as the client gave to the server. It then responds to the client's request with whatever the url responds with.