Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stirby/hostsplitter
Golang HTTP reverse proxy which splits traffic based on the Host header
https://github.com/stirby/hostsplitter
Last synced: about 11 hours ago
JSON representation
Golang HTTP reverse proxy which splits traffic based on the Host header
- Host: GitHub
- URL: https://github.com/stirby/hostsplitter
- Owner: stirby
- License: mit
- Created: 2016-02-04T03:47:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T23:18:54.000Z (about 1 year ago)
- Last Synced: 2024-05-21T05:54:26.838Z (5 months ago)
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 63
- Watchers: 6
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HostSplitter
HostSplitter is an HTTP reverse proxy and load balancer that distributes requests to an arbitrary amount of sites based on the Host header.## Motivation
I commonly run into an issue developing small golang websites: I want to use the same IP address for many sites that aren't large enough to justify their own VPS.## Site files
HostSplitter will look for site files by default in "/etc/hostsplitter/". HostSplitter will only read files with the .json extension.A each site file should look like
```json
{
"hostnames": [
"skirby.dev",
"www.skirby.dev"
],
"backends": [
"127.0.0.1:9000"
],
"secret": "puppies1234"
}
```The "secret" field is passed along with every request to that site in the ``X-Hostsplitter-Secret`` header. This is intended to be checked before trusting the passed along IP.
## Real IP
The original requester's IP is located in the ``X-Forwarded-For`` header.## Reloading
HostSplitter provides 0 downtime reload functionality via SIGUSR1. E.g
```bash
pkill -10 hostsplitter## Roadmap
- SSL