Go to file
2023-02-11 00:54:51 +01:00
.gitignore Fix path 2023-02-11 00:14:45 +01:00
go.mod Upgrade golang.org/x/crypto to v0.6.0 2023-02-11 00:53:15 +01:00
go.sum Upgrade golang.org/x/crypto to v0.6.0 2023-02-11 00:53:15 +01:00
LICENSE.md Remove year from license 2023-02-11 00:54:51 +01:00
Makefile Hard-code testing target host 2023-02-11 00:15:48 +01:00
README.md Add clarification 2023-02-11 00:27:40 +01:00
server_test.go Only test received headers when it is required, improve syntax 2023-02-11 00:27:19 +01:00
server.go Improve log formatting, syntax and order. Require TLS 1.2 when acting as a server 2023-02-11 00:26:46 +01:00

SDF Home Proxy

An http server to which one or more domains can be pointed to. Incoming requests will be proxied to an arbitrary target http server, like Amazon S3, Blogger.com or one of the many options available at sdf.org.

The main goal is to serve content for a domain via a server which requires no configuration, handles TLS and can run on mostly any host on the internet with an IP address in one's possession. Obviously this solution is an end in itself and there already is Caddy.

Thanks to golang.org/x/crypto/acme/autocert, the server will automatically attempt to get a certificate from Let's Encrypt via the HTTP-01 challenge to enable TLS.

Usage

$ make build
$ export SDF_PROXY_LETS_ENCRYPT_EMAIL=domainadmin@example.com
$ export SDF_PROXY_ALLOWED_HOSTS=example.com,www.example.com
$ export SDF_PROXY_TARGET_HOST=example.sdf.org
$ export SDF_PROXY_TARGET_SCHEME=https
$ ./server

Future Ideas

  • Support for rewriting URL paths
  • Configuration option to keep keys and TLS certificates in memory only
  • Support for cgi-bin and/or FastCGI
  • Support for translating between protocols other than http for target servers
  • Support for logging and rudimentary analytics