1
1
# vproxy
2
2
3
- > Zero-config virtual proxies with TLS
3
+ > Zero-config virtual proxies with TLS, for local development
4
4
5
5
Automatically create and manage hosts files and TLS certificates for any
6
6
hostname using a locally-trusted CA (via
@@ -18,50 +18,68 @@ brew install vproxy
18
18
or manually:
19
19
20
20
1 . Install [ mkcert] ( https://github.com/FiloSottile/mkcert/#installation )
21
- 2 . Build it :
21
+ 2 . Download a [ pre-built binary ] ( https://github.com/jittering/vproxy/releases ) or build it from source :
22
22
23
23
``` sh
24
24
go get github.com/jittering/vproxy/...
25
25
```
26
26
27
+ ### Initialize mkcert
28
+
29
+ Create install a new local-CA in your system:
30
+
31
+ ``` sh
32
+ mkcert -install
33
+ ```
34
+
27
35
## Usage
28
36
29
37
vproxy consists of two processes: daemon and client.
30
38
31
39
* The __ daemon__ serves as the primary host of the HTTP & HTTPS endpoints for
32
40
your various applications.
33
41
* The __ client__ registers a service with the daemon and relays all access logs
34
- to the current terminal.
42
+ to the current terminal. It can also optionally run the service for you.
43
+
44
+ A single daemon is required per-host, while clients can be run multiple times.
35
45
36
46
### daemon
37
47
38
- A single daemon is required per-host :
48
+ If installed via homebrew on macOS, running it as a service is easy :
39
49
40
50
``` sh
41
- $ vproxy daemon
42
- [* ] rerunning with sudo
43
- Password:
44
- [* ] starting proxy: http://127.0.0.1:80
45
- [* ] starting proxy: https://127.0.0.1:443
51
+ sudo brew services start vproxy
46
52
```
47
53
48
- Note that * sudo* is required to bind to privileged ports.
54
+ > Note that you must run as root to bind to privileged ports (hence the use of
55
+ > sudo above).
49
56
50
- Alternatively, run it as a homebrew service (macOS only), so it will start
51
- automatically:
57
+ Or run it manually:
52
58
53
59
``` sh
54
- sudo brew services start vproxy
60
+ $ vproxy daemon
61
+ [* ] rerunning with sudo
62
+ Password:
63
+ [* ] starting proxy: http://127.0.0.1:80
64
+ [* ] starting proxy: https://127.0.0.1:443
55
65
```
56
66
57
67
### client
58
68
69
+ Use the client to bind a hostname to a local port:
70
+
59
71
``` sh
60
72
$ vproxy client --bind foo.local.com:5000
61
73
[* ] registering vhost: foo.local.com:5000
62
74
```
63
75
64
- You can even run the underlying service directly, for ease of use:
76
+ The daemon will automatically:
77
+
78
+ * Issue a TLS cert for ` foo.local.com `
79
+ * Add ` foo.local.com ` to your hosts file (e.g., /etc/hosts)
80
+ * Add a reverse proxy vhost connecting ` foo.local.com ` to port 5000
81
+
82
+ You can even run the underlying service with one command, for ease of use:
65
83
66
84
``` sh
67
85
$ vproxy client --bind foo.local.com:5000 -- flask run
@@ -76,10 +94,12 @@ $ vproxy client --bind foo.local.com:5000 -- flask run
76
94
```
77
95
78
96
Now visit https://foo.local.com/ to access your application originally running
79
- on http://127.0.0.1:8080
97
+ on http://127.0.0.1:5000
98
+
99
+ 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.
80
100
81
101
## License
82
102
83
- MIT, (c) 2020 , Pixelcop Research, Inc.
103
+ MIT, (c) 2021 , Pixelcop Research, Inc.
84
104
85
105
Originally based on [ simpleproxy] ( https://github.com/ybrs/simpleproxy ) - MIT (c) 2016 aybars badur.
0 commit comments