https://github.com/abbychau/slashing
Reverse Proxy + Static File Server + Let's Encrypt + multiple hosts + Redis-Compatible-KV + SQLite Server in ONE process.
https://github.com/abbychau/slashing
Last synced: 2 months ago
JSON representation
Reverse Proxy + Static File Server + Let's Encrypt + multiple hosts + Redis-Compatible-KV + SQLite Server in ONE process.
- Host: GitHub
- URL: https://github.com/abbychau/slashing
- Owner: abbychau
- Created: 2021-07-08T12:29:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-29T07:17:01.000Z (almost 4 years ago)
- Last Synced: 2025-03-18T15:13:05.126Z (3 months ago)
- Language: Go
- Homepage:
- Size: 4.28 MB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Slashing
This is a HTTPS server, which aims to replace my personal nginx usages.
Currently, it serves Reverse Proxying (e.g. to a Python-Flask,Java,PHP-Swoole,etc. server) , Static File Serving , Let's Encrypt with multiple hosts support.
It also does proxy load-balancing in robin-round mannerUpdate:
It is now:
Reverse Proxy + Static File Server + Let's Encrypt + multiple hosts + Redis-Compatible-KV + SQLite Server in ONE process.## Usage
1. Edit config.txtExplanation:
```
#reverse proxy targets
backend=127.0.0.1:9527
backend=127.0.0.1:9528
backend=127.0.0.1:9529
backend=127.0.0.1:9530
#... you can add as many as you want
#redis port and address
redis=127.0.0.1:10060
#sqlite port and address
rdbms=127.0.0.1:10061
#domain and paths to serve static files
#domain=leveling.m2np.com:/home/wwwroot/leveling.m2np.com
#domain=level.m2np.com:/root/level```
2. Start the server with the file name of the config.
```
./slashing config.txt
```You should see logs similar to:
```
2021/07/08 21:13:59 Start slashing...
2021/07/08 21:13:59 Certificate cache directory is : cache-golang-autocert-root
2021/07/08 21:13:59 Starting HTTP->HTTPS redirector and HTTPS server...
```3. The first time a domain is visited, it will undergo Let's encrypt challange and the autocerts will be stored under the directory you started `slashing`.
##
## Why it is called slashing
Because it slashed NGINX, Redis, MySQL(although it is a sqlite behind). And AutoCert is so comfortable!## Development Note
- install protoc and proto-go-gen: https://grpc.io/docs/languages/go/quickstart/
- `protoc --proto_path=raftproto --go_out=raftproto --go_opt=paths=source_relative service.proto`