A super simple reverse proxy.
Project description
A super simple HTTP/1.1 proxy, with TLS support.
Install from PyPI:
$ pip install rproxy
Make a rproxy.ini:
[rproxy]
certs=certificates
http_ports=80
https_ports=443
[hosts]
mysite.com_port=8080
Then run it:
sudo twistd -u nobody -g nobody -n rproxy
This will start the server, drop permissions (setting the effective uid/guid to nobody), and will proxy incoming requests to mysite.com to localhost:8080. You can configure it further:
[rproxy]
certs=certificates
letsencrypt=le
http_ports=80,8080
https_ports=443
clacks=true
[hosts]
mysite.com_port=8080
mysite.com_host=otherserver
mysite.com_onlysecure=True
mysite.com_proxysecure=True
myothersite.net_port=8081
This config will:
connect to https://otherserver:8080 as the proxied server for mysite.com, and only allow HTTPS connections to the proxy for this site
connect to http://localhost:8081 as the proxied server for myothersite.net, and allow HTTP or HTTPS connections.
General Config
http_ports – comma-separated list of numerical ports to listen on for HTTP connections.
https_ports – comma-separated list of numerical ports to listen on for HTTPS connections.
certificates – directory where certificates are kept. rproxy looks for <host>.pem in this folder when serving HTTPS sites.
letsencrypt – directory where Let’s Encrypt ACME challenges are kept – the “webroot” parameter for https://github.com/kuba/simp_le . rproxy looks for <host>/.well-known/acme-challenge in this folder when serving Let’s Encrypt HTTP-01 challenges.
clacks – Enable X-Clacks-Overhead for requests.
Hosts Config
<host>_onlysecure – enforce HTTPS connections. If not set, or set to False, it will allow HTTP and HTTPS connections.
<host>_proxysecure – connect to the proxied server by HTTPS. If not set, or set to False, it will connect over HTTP.
<host>_port – The port of the proxied server that this proxy should connect to.
<host>_host – the hostname/IP of the server to proxy to.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file rproxy-16.1.1.tar.gz
.
File metadata
- Download URL: rproxy-16.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d45635c35210268a44285b4e27afb58da42ecb2dd21af0fd80b10c24a76188da |
|
MD5 | a8a36c522efc507f5136d27e2e3c9571 |
|
BLAKE2b-256 | 0a7f46f56afaf141fdf2311c5a6b21d0c3aa5cc1394bcbd219b78499d27b3aa0 |