Commit 8d606734 authored by Aral Balkan's avatar Aral Balkan

Document the new development-time reverse proxy feature

parent a89244bf
......@@ -16,16 +16,14 @@ __Indie Web Server is a secure and seamless [Small Tech](https://ar.al/2019/03/0
Copy and paste the following commands into your terminal:
### Linux
### Linux and macOS
```
wget https://ind.ie/web-server/linux/8.0.0.zip && unzip 8.0.0.zip && chmod +x web-server && sudo mv web-server /usr/local/bin/
```
Install the native binaries:
### macOS
__Before you pipe any script into your computer, always [view the source code](https://ind.ie/web-server/install.sh) and make sure you understand what it does.__
```
wget https://ind.ie/web-server/macos/8.0.0.zip && unzip 8.0.0.zip && chmod +x web-server && sudo mv web-server /usr/local/bin/
wget -qO- https://ind.ie/web-server/install.sh | bash
```
### Node.js
......@@ -34,6 +32,8 @@ wget https://ind.ie/web-server/macos/8.0.0.zip && unzip 8.0.0.zip && chmod +x we
npm i -g @ind.ie/web-server
```
There is currently no native binary support for Windows. Please use the npm installation method on that platform.
## Use
### Local
......@@ -44,6 +44,14 @@ Start serving the current directory at https://localhost as a regular process us
$ web-server
```
You can also use Indie Web Server as a development-time reverse proxy for HTTP and WebSocket connections. For example, if you use [Hugo](https://gohugo.io/) and you’re running `hugo server` on the default HTTP port 1313. You can run a HTTPS reverse proxy at https://localhost [with LiveReload support]() with:
```shell
$ web-server http://localhost:1313
```
The reverse proxy feature is currently not available for use with the `global` or `enable` features.
### Global (ephemeral)
__Available on Linux and macOS only*__
......
......@@ -225,6 +225,15 @@ switch (true) {
target: pathToServe,
changeOrigin: true,
//logLevel: 'debug',
//
// Special handling of LiveReload implementation bug in Hugo
// to workaround the port being hardcoded to the Hugo server
// port (instead of the port that the page is being served from).
//
// This enables you to use Indie Web Server as a reverse proxy
// for Hugo during development time and test your site from https://localhost
//
onProxyRes: (proxyResponse, request, response) => {
const _write = response.write
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment