RoadSign/README.md

101 lines
3.8 KiB
Markdown
Raw Normal View History

2023-11-17 16:23:40 +00:00
# 🚦 RoadSign
2024-09-29 15:51:05 +00:00
A blazing fast http server with a lot of shining features.
2023-11-17 16:23:40 +00:00
## Features
1. Reverse proxy
2. WebSocket Support
3. Static File Hosting
4. Low Configuration
5. Analytics and Metrics
6. Integrate with CI/CD
2024-09-29 15:51:05 +00:00
7. One-liner CLI
8. Open-source and free
9. **Blazing fast ⚡**
2024-01-26 05:24:25 +00:00
2024-09-29 15:51:05 +00:00
But, as we said, this isn't a reverse proxy. It's a http server.
So we didn't recommend you directly use it as a gateway to users, because it doesn't support all the features of http.
For example like doesn't support multiple site HTTPS, HTTP/2.0, HTTP/3 and Server-Side Events.
You can use RoadSign behind a reverse proxy like caddy, and let it handle the HTTP/2.0, HTTP/3 and all the other
cutting-edge stuff.
2023-11-17 17:42:04 +00:00
2023-11-17 17:50:16 +00:00
### How fast is it?
2024-09-29 15:51:05 +00:00
We use roadsign and nginx to host the same static file
and test them with [go-wrk](https://github.com/tsliwowicz/go-wrk).
2023-11-24 17:27:37 +00:00
Here's the result:
2023-12-12 12:49:03 +00:00
| **Software** | Total Requests | Requests per Seconds | Transfer per Seconds | Avg Time | Fastest Time | Slowest Time | Errors Count |
2023-11-30 14:35:46 +00:00
|:---------------------:|:--------------:|:--------------------:|:--------------------:|:-----------:|:------------:|:------------:|:------------:|
2023-12-12 12:49:03 +00:00
| _Nginx_ | 515749 | 4299.58 | 2.05MB | 13.954846ms | 0s (Cached) | 410.6972ms | 0 |
| _RoadSign_ | 8905230 | 76626.70 | 30.98MB | 783.016µs | 28.542µs | 46.773083ms | 0 |
| _RoadSign w/ Prefork_ | 4784308 | 40170.41 | 16.24MB | 1.493636ms | 34.291µs | 8.727666ms | 0 |
2023-11-24 17:27:37 +00:00
As result, roadsign undoubtedly is the fastest one.
2023-12-12 12:49:03 +00:00
It can be found that the prefork feature makes RoadSign more stable in concurrency. We can see this from the **Slowest
Time**. At the same time, the **Fastest Time** is affected because reusing ports requires some extra steps to handle
load balancing. Enable this feature at your own discretion depending on your use case.
2023-11-30 14:35:46 +00:00
2023-12-12 12:49:03 +00:00
More details can be found at benchmark's [README.md](./test/README.md)
## Installation
We strongly recommend you install RoadSign via docker compose.
```yaml
version: "3"
services:
roadsign:
2024-01-26 05:24:25 +00:00
image: xsheep2010/roadsign:nightly
2023-12-12 12:49:03 +00:00
restart: always
volumes:
- "./certs:/certs" # Optional, use for storage certificates
- "./config:/config"
- "./wwwroot:/wwwroot" # Optional, use for storage web apps
- "./settings.yml:/settings.yml"
ports:
- "80:80"
- "443:443"
- "81:81"
```
2024-01-26 05:24:25 +00:00
After that, you can manage your roadsign instance with RoadSign CLI aka. RDC.
2023-12-12 12:49:03 +00:00
To install it, run this command. (Make sure you have golang toolchain on your computer)
```shell
2024-09-29 15:03:11 +00:00
go install git.solsynth.dev/goatworks/roadsign/pkg/cmd/rdc@latest
2023-12-12 12:49:03 +00:00
```
## Usage
To use roadsign, you need to add a configuration for it. Create a file locally.
2024-09-29 15:51:05 +00:00
Name whatever you like. And follow our [documentation](https://wiki.smartsheep.studio/roadsign/configuration/index.html)
to
2023-12-12 12:49:03 +00:00
write it.
After configure, you need sync your config to remote server. Before that, add a connection between roadsign server and
rds cli with this command.
```shell
2024-01-26 05:24:25 +00:00
rdc connect <id> <url> <password>
2023-12-12 12:49:03 +00:00
# ID will allow you find this server in after commands.
2023-12-13 11:52:56 +00:00
# URL is to your roadsign server sideload api.
2023-12-12 12:49:03 +00:00
# Password is your roadsign server credential.
# ======================================================================
# !WARNING! All these things will storage in your $HOME/.roadsignrc.yaml
# ======================================================================
```
Then, sync your local config to remote.
```shell
2024-01-26 05:24:25 +00:00
rdc sync <server id> <region id> <config file>
2023-12-12 12:49:03 +00:00
# Server ID is your server added by last command.
# Site ID is your new site id or old site id if you need update it.
# Config File is your local config file path.
```
After a few seconds, your website is ready!