Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fssay/cf-hub
Run multiple HTTP servers on the same machine and be able to connect to each using a single port via Cloudflare.
https://github.com/fssay/cf-hub
cloudflare http http-server hyper-rs proxy rust rust-lang tls-support
Last synced: 15 days ago
JSON representation
Run multiple HTTP servers on the same machine and be able to connect to each using a single port via Cloudflare.
- Host: GitHub
- URL: https://github.com/fssay/cf-hub
- Owner: FssAy
- License: mit
- Created: 2024-05-09T22:00:11.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-09-14T14:54:30.000Z (3 months ago)
- Last Synced: 2024-10-19T16:04:24.235Z (2 months ago)
- Topics: cloudflare, http, http-server, hyper-rs, proxy, rust, rust-lang, tls-support
- Language: Rust
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloudflare HUB
Small executable to run multiple HTTP servers on the same machine and be able to connect to each using a single port via Cloudflare.### Motivation
Cloudflare doesn't allow to specify origin server's port on a free tier, so when you run 2 HTTP servers.
First on port 1234 and the second one on 5678 in order to connect to them, you have to specify the port in the URL.
Just as follows: `server1.com:1234` and `server2.org:5678`.### Solution
I think there might be a way to do that with Cloudflare redirects, but it didn't work for me.This application will intercept every request intended for each defined host and will redirect it to a specified IP.
### How to use
On the machine:
1. Run the `cf-hub` to generate a config `cf-hub-cfg.json`.
2. In the config file:
- Set `addr_server` to the address on which the CF-HUB should operate.
In most cases it should be your machine's WAN IP and port 443.
- In `hosts` specify your hosts and servers where the JSON value
is an IP and port of the application serving the website. For example: `"server1.com": "127.0.0.1:1234"`.
3. Run your servers.
4. Run `cf-hub`.### Disclaimer
1. This is a simple program which shouldn't be used with high demanding platforms.
It's intended for small hobby projects where the owner doesn't have enough funds to
use different machines for each server.2. It doesn't support WebSockets.
3. It's intended for Cloudflare domains, it won't work separately.
3. There might be some unforeseen issues due to the nature of HTTP.
### ToDo:
- [ ] Better error handling.
- [ ] Support WebSockets.
- [x] Fix issues with TLS.