Skip to content

Commit

Permalink
docs: updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
chetan committed Jul 21, 2022
1 parent 0e5b72b commit 1f57478
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__A zero-config service mesh for local development__

Stop trying to remember port numbers and create secure endpoints for all of your
Stop trying to remember port numbers and create secure endpoints for your
services. Automatically updates your hosts file, generates TLS certificates,
(via
[mkcert](https://github.com/FiloSottile/mkcert)/[truststore](https://github.com/jittering/truststore)),
Expand All @@ -29,12 +29,15 @@ via homebrew (mac or linux):
brew install jittering/kegs/vproxy
```

or manually:
or manually (macOS, linux, windows):

Download a [pre-built binary](https://github.com/jittering/vproxy/releases) or build it from source:
- Download a [pre-built binary](https://github.com/jittering/vproxy/releases)
- Install in proper location, e.g., `/usr/local/bin/` or `%SYSTEMROOT%\System32\`

or build it from source:

```sh
go get github.com/jittering/vproxy/...
go install github.com/jittering/vproxy/bin/vproxy@master
```

### Initialize local root CA
Expand All @@ -47,15 +50,19 @@ vproxy caroot --create

## Usage

vproxy can run in two modes, depending on the use case: single-process for proxying a single service or with a standalone daemon for proxying more than one service.

vproxy consists of two processes: daemon and client.

* The __daemon__ serves as the primary host of the HTTP & HTTPS endpoints for
your various applications.
* The __client__ registers a service with the daemon and relays all access logs
- The __daemon__ serves as the primary host of the HTTP & HTTPS endpoints for
your applications.
- The __client__ registers a service with the daemon and relays all access logs
to the current terminal. It can also optionally run the service for you.

A single daemon is required per-host, while clients can be run multiple times.

In single-process mode, skip the daemon section.

### daemon

If installed via homebrew on macOS, running it as a service is easy:
Expand Down Expand Up @@ -88,9 +95,9 @@ $ vproxy connect --bind foo.local.com:5000

The daemon will automatically:

* Issue a TLS cert for `foo.local.com`
* Add `foo.local.com` to your hosts file (e.g., /etc/hosts)
* Add a reverse proxy vhost connecting `foo.local.com` to port 5000
- Issue a TLS cert for `foo.local.com`
- Add `foo.local.com` to your hosts file (e.g., /etc/hosts)
- Add a reverse proxy vhost connecting `foo.local.com` to port 5000

You can even run the underlying service with one command, for ease of use:

Expand All @@ -106,13 +113,25 @@ $ vproxy connect --bind foo.local.com:5000 -- flask run
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
```

Now visit https://foo.local.com/ to access your application originally running
Now visit https://foo.local.com to access your application originally running
on http://127.0.0.1:5000

When you stop the client process (i.e., by pressing `^C`), vproxy will deregister the vhost with the daemon and send a TERM signal to it's child process.

### Permissions

A couple of notes on permissions. The vproxy *daemon* must be run with elevated privileges for the following reasons:

- macOS or Linux: binding on privileged ports 80/443 and modifying `/etc/hosts`
- Windows: `modifying %SYSTEMROOT%\System32\drivers\etc\hosts`
- All: installing our local CA into the system trust stores (system prompt)

On mac or linux this means running as root (or via sudo).

On Windows this means running via an elevated command prompt.

## License

MIT, (c) 2021, Pixelcop Research, Inc.
MIT, (c) 2022, Pixelcop Research, Inc.

Originally based on [simpleproxy](https://github.com/ybrs/simpleproxy) - MIT (c) 2016 aybars badur.

0 comments on commit 1f57478

Please sign in to comment.