Skip to content

Commit 269b7b0

Browse files
committed
chore: bump version to v0.7.0
1 parent 9fc332a commit 269b7b0

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "http-server"
3-
version = "0.6.0"
3+
version = "0.7.0"
44
authors = ["Esteban Borai <estebanborai@gmail.com>"]
55
edition = "2018"
66
description = "Simple and configurable command-line HTTP server"

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,28 @@ TLS Key | N/A | `--tls-key` | Path to TLS key file. **Depends on `--tls`** | `ke
9797
TLS Key Algorithm | N/A | `--tls-key-algorithm` | Algorithm used to generate certificate key. **Depends on `--tls`** | `rsa`
9898
Username | N/A | `--username` | Specify the username to validate using basic authentication | N/A
9999
Password | N/A | `--password` | Specify the password to validate using basic authentication. **Depends on `--username`** | N/A
100+
Proxy | N/A | `--proxy` | Proxy requests to the provided URL | N/A
101+
102+
## Request Handlers
103+
104+
This HTTP Proxy supports different _Request Handlers_, this determines how each
105+
incoming HTTP request must be handled, they can't be combinable so you must
106+
choose one based on your needs.
107+
108+
- [File Server](#file-server-handler)
109+
- [Proxy](#proxy-handler)
110+
111+
### File Server Handler
112+
113+
Useful for serving files in the provided directory. Navigation is scoped to the
114+
specified directory, if no directory is provided the CWD will be used.
115+
116+
> This is the default behavior for the HTTP server.
117+
118+
### Proxy Handler
119+
120+
Proxies requests to the provided URL. The URL provided is used as the base URL
121+
for incoming requests.
100122

101123
## References
102124

@@ -201,6 +223,20 @@ username = "John"
201223
password = "Appleseed"
202224
```
203225

226+
### Proxy
227+
228+
The HTTP Server is able to proxy requests to an specified URL.
229+
230+
By using the proxy the FileExplorer wont be available, the proxy is considered
231+
a _Request Handler_.
232+
233+
The config TOML file can be used to provide proxy configurations:
234+
235+
```toml
236+
[proxy]
237+
url = "https://example.com"
238+
```
239+
204240
## Release
205241

206242
In order to create a release you must push a Git tag as follows

fixtures/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ port = 7878
2727
# [basic_auth]
2828
# username = "John"
2929
# password = "Appleseed"
30+
31+
# [proxy]
32+
# url = "https://example.com"

0 commit comments

Comments
 (0)