2828cargo install http-server
2929```
3030
31- Check for the installation to be successful .
31+ Verify successful installation.
3232
3333``` bash
3434http-server --help
3535```
3636
37- Expect the following output
37+ Expect the following output:
3838
3939```
4040USAGE:
@@ -65,12 +65,12 @@ ARGS:
6565 <root-dir> Directory to serve files from [default: ./]
6666```
6767
68- > If you find this output is out-of- date, don't hesitate to open a [ PR here] [ 1 ] .
68+ > If you find this output is out of date, don't hesitate to open a [ PR here] [ 1 ] .
6969
7070## Configuration
7171
7272When running the server with no options or flags provided, a set of default
73- configurations will be set, you can always change this behavior by either
73+ configurations will be used. You can always change this behavior by either
7474creating your own config with the [ Configuration TOML] ( https://github.com/EstebanBorai/http-server/blob/main/fixtures/config.toml ) file
7575or by providing CLI arguments described in the [ usage] ( #usage ) section.
7676
@@ -106,15 +106,15 @@ Name | Short | Long | Description
106106--- | --- | --- | ---
107107Cross-Origin Resource Sharing | N/A | ` --cors ` | Enable Cross-Origin Resource Sharing allowing any origin
108108GZip Compression | N/A | ` --gzip ` | Enable GZip compression for responses
109- Graceful Shutdown | N/A | ` --graceful-shutdown ` | Waits for all requests to fulfill before shutting down the server
110- Help | N/A | ` --help ` | Prints help information
111- Logger | ` -l ` | ` --logger ` | Prints HTTP request and response details to stdout
112- Version | ` -V ` | ` --version ` | Prints version information
113- Verbose | ` -v ` | ` --verbose ` | Prints output to console
109+ Graceful Shutdown | N/A | ` --graceful-shutdown ` | Wait for all requests to be fulfilled before shutting down the server
110+ Help | N/A | ` --help ` | Print help information
111+ Logger | ` -l ` | ` --logger ` | Print HTTP request and response details to stdout
112+ Version | ` -V ` | ` --version ` | Print version information
113+ Verbose | ` -v ` | ` --verbose ` | Print output to console
114114
115115### Options
116116
117- Options receives a value and have support for default values as well.
117+ Options receive a value and support default values as well.
118118
119119```
120120http-server --host 127.0.0.1
@@ -124,28 +124,28 @@ Name | Short | Long | Description | Default Value
124124--- | --- | --- | --- | ---
125125Host | ` -h ` | ` --host ` | Address to bind the server | ` 127.0.0.1 `
126126Port | ` -p ` | ` --port ` | Port to bind the server | ` 7878 `
127- Configuration File | ` -c ` | ` --config ` | Specifies a configuration file. [ Example] ( https://github.com/EstebanBorai/http-server/blob/main/fixtures/config.toml ) | N/A
127+ Configuration File | ` -c ` | ` --config ` | Configuration file. [ Example] ( https://github.com/EstebanBorai/http-server/blob/main/fixtures/config.toml ) | N/A
128128TLS | N/A | ` --tls ` | Enable TLS for HTTPS connections. Requires a Certificate and Key. [ Reference] ( #tls-reference ) | N/A
129129TLS Ceritificate | N/A | ` --tls-cert ` | Path to TLS certificate file. ** Depends on ` --tls ` ** | ` cert.pem `
130130TLS Key | N/A | ` --tls-key ` | Path to TLS key file. ** Depends on ` --tls ` ** | ` key.rsa `
131131TLS Key Algorithm | N/A | ` --tls-key-algorithm ` | Algorithm used to generate certificate key. ** Depends on ` --tls ` ** | ` rsa `
132- Username | N/A | ` --username ` | Specify the username to validate using basic authentication | N/A
133- Password | N/A | ` --password ` | Specify the password to validate using basic authentication. ** Depends on ` --username ` ** | N/A
132+ Username | N/A | ` --username ` | Username to validate using basic authentication | N/A
133+ Password | N/A | ` --password ` | Password to validate using basic authentication. ** Depends on ` --username ` ** | N/A
134134Proxy | N/A | ` --proxy ` | Proxy requests to the provided URL | N/A
135135
136136## Request Handlers
137137
138- This HTTP Proxy supports different _ Request Handlers_ , this determines how each
139- incoming HTTP request must be handled, they can't be combinable so you must
138+ This HTTP Proxy supports different _ Request Handlers_ which determine how each
139+ incoming HTTP request is handled. They can't be combined, you must
140140choose one based on your needs.
141141
142- - [ File Server] ( #file-server-handler )
142+ - [ File Server] ( #file-server-handler ) _ default _
143143- [ Proxy] ( #proxy-handler )
144144
145145### File Server Handler
146146
147- Useful for serving files in the provided directory. Navigation is scoped to the
148- specified directory, if no directory is provided the CWD will be used.
147+ Serves files from the provided directory. Navigation is scoped to the
148+ specified directory. If no directory is provided the CWD will be used.
149149
150150> This is the default behavior for the HTTP server.
151151
@@ -154,22 +154,22 @@ specified directory, if no directory is provided the CWD will be used.
154154Proxies requests to the provided URL. The URL provided is used as the base URL
155155for incoming requests.
156156
157- ## References
157+ ## Reference
158158
159159The following are some relevant details on features supported by this HTTP Server
160- solution that may be of the interest of the user.
160+ that may be of interest to the user.
161161
162162### Compression
163163
164- Even when compression is supported, by default the server will not compress any
164+ Even though compression is supported, by default the server will not compress any
165165HTTP response contents.
166+ You must specify the compression configuration you want to use, in the
167+ configuration file or on the command line.
166168
167- You must specify the compression configuration you want to use, as of today
168- the server only supports compression with the GZip algorithm, but ` brotli ` is
169- also planed to be supported, that's why theres two ways to configure this
170- server to use compression.
169+ As of today the server only supports compression with the GZip algorithm, but
170+ ` brotli ` support is also planned.
171171
172- The following MIME types will be skipped from compression :
172+ The following MIME types are never compressed :
173173
174174- ` application/gzip `
175175- ` application/octet-stream `
@@ -180,8 +180,8 @@ The following MIME types will be skipped from compression:
180180
181181#### The Configuration File's Compression Section
182182
183- As suppport for other compression algorithms is planned to be provided in the
184- future, the configuration file already supports compression settings.
183+ As future support for other compression algorithms is planned,
184+ the configuration file already supports compression settings.
185185
186186``` toml
187187[compression ]
@@ -198,16 +198,16 @@ http-server --gzip
198198
199199### TLS (HTTPS)
200200
201- The TLS solution supported for this HTTP Server is built with [ rustls] ( https://github.com/ctz/rustls )
201+ The TLS solution supported for this HTTP Server is built with the [ rustls] ( https://github.com/ctz/rustls )
202202crate along with [ hyper-rustls] ( https://github.com/ctz/hyper-rustls ) .
203203
204204When running with TLS support you will need:
205205
206206- A certificate
207- - A RSA Private Key for such certificate
207+ - A matching RSA Private Key for the certificate
208208
209209A script to generate certificates and keys is available here [ tls-cert.sh] ( ./docs/tls-cert.sh ) .
210- This script relies on ` openssl ` , so make sure you have it installed in your system.
210+ This script relies on ` openssl ` , so make sure you have it installed on your system.
211211
212212Run ` http-server ` as follows:
213213
@@ -217,19 +217,18 @@ http-server --tls --tls-cert <PATH TO YOUR CERTIFICATE> --tls-key <PATH TO YOUR
217217
218218### Cross-Origin Resource Sharing (CORS)
219219
220- This HTTP Server brings support to CORS headers _ out of the box_ .
221- Based on the headers you want to provide to your HTTP Responses, 2
220+ This HTTP Server supports CORS headers _ out of the box_ .
221+ Based on the headers you want to provide in your HTTP Responses, two
222222different methods for CORS configuration are available.
223223
224- By providing the ` --cors ` option to the ` http-server ` , CORS headers
224+ By providing the ` --cors ` option to ` http-server ` , CORS headers
225225will be appended to every HTTP Response, allowing any origin.
226226
227227For more complex configurations, like specifying an origin, a set of allowed
228228HTTP methods and more, you should specify the configuration via the configuration
229229TOML file.
230230
231- The following example shows all the options available, these options are
232- mapped to the server configuration during initialization.
231+ The following example shows all the available options.
233232
234233``` toml
235234[cors ]
@@ -259,10 +258,10 @@ password = "Appleseed"
259258
260259### Proxy
261260
262- The HTTP Server is able to proxy requests to an specified URL.
261+ The HTTP Server is able to proxy requests to a specified URL.
263262
264- By using the proxy the FileExplorer wont be available, the proxy is considered
265- a _ Request Handler_ .
263+ When using the proxy, the FileExplorer won't be available, as the proxy is
264+ an alternate _ Request Handler_ .
266265
267266The config TOML file can be used to provide proxy configurations:
268267
@@ -275,13 +274,13 @@ url = "https://example.com"
275274
276275The following roadmap list features to provide for the version ` v1.0.0 ` .
277276
278- This roadmap still open for suggestions, if you find that theres a missing
279- feature in this list, you would like to work on or expect for the first
280- stable release, please contact software editors by opening an issue or a
277+ This roadmap is still open for suggestions. If you find that there's a missing
278+ feature in this list, that you would like to work on or expect for the first
279+ stable release, please contact the software editors by opening an issue or a
281280discussion.
282281
283282If you want to contribute to one of these, please make sure
284- theres an issue tracking the feature and ping me. Otherwise
283+ there's an issue tracking the feature and ping me. Otherwise
285284open an issue to be assigned and track the progress there.
286285
287286- [x] Logging
@@ -351,7 +350,7 @@ git tag -a <version> -m <message>
351350git tag -a v0.1.0 -m " First release"
352351```
353352
354- > Tags must follow semver conventions
353+ > Tags must follow semver conventions.
355354> Tags must be prefixed with a lowercase ` v ` letter.
356355
357356Then push tags as follows:
@@ -362,8 +361,8 @@ git push origin main --follow-tags
362361
363362## Contributing
364363
365- Every contribution to this project is welcome. Feel free to open a pull request,
366- an issue or just by starting this project.
364+ Every contribution to this project is welcome. Feel free to open a pull request or
365+ an issue. Just by using this project you're helping it grow. Thank you!
367366
368367## License
369368
0 commit comments