You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-35Lines changed: 58 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Chisel is an HTTP client and server which acts as a TCP proxy, written in Go (Go
8
8
9
9
**Binaries**
10
10
11
-
See [Releases](https://github.com/jpillora/chisel/releases)
11
+
See [Releases](https://github.com/jpillora/chisel/releases/latest)
12
12
13
13
**Source**
14
14
@@ -20,7 +20,8 @@ $ go get -v github.com/jpillora/chisel
20
20
21
21
* Easy to use
22
22
*[Performant](#performance)*
23
-
*[Encrypted connections](https://github.com/jpillora/conncrypt) with `key` derived (PBKDF2) symmetric key[*](#security)
23
+
*[Encrypted connections](#security) using `crypto/ssh`
24
+
*[Authenticated connections](#authentication) using a users config file
24
25
* Client auto-reconnects with [exponential backoff](https://github.com/jpillora/backoff)
25
26
* Client can create multiple tunnel endpoints over one TCP connection
26
27
* Server optionally doubles as a [reverse proxy](http://golang.org/pkg/net/http/httputil/#NewSingleHostReverseProxy)
@@ -30,22 +31,19 @@ $ go get -v github.com/jpillora/chisel
30
31
A [demo app](https://chisel-demo.herokuapp.com) on Heroku is running this `chisel server`:
31
32
32
33
```sh
33
-
$ chisel server --key foobar --port $PORT --proxy http://example.com
34
-
# listens on $PORT, requires password 'foobar', proxy web requests to 'http://example.com'
34
+
$ chisel server --port $PORT --proxy http://example.com
35
+
# listens on $PORT, proxy web requests to 'http://example.com'
35
36
```
36
37
37
38
This demo app is also running a [simple file server](https://www.npmjs.com/package/serve) on `:3000`, which is normally inaccessible due to Heroku's firewall. However, if we tunnel in with:
# connects to 'https://chisel-demo.herokuapp.com',
42
43
# tunnels your localhost:3000 to the server's localhost:3000
43
44
```
44
45
45
-
and then visit [localhost:3000](http://localhost:3000/), we should
46
-
see a directory listing of the demo app's root. Also, if we visit
47
-
the [demo app](https://chisel-demo.herokuapp.com) in the browser we should hit the server's
48
-
default proxy and see a copy of [example.com](http://example.com).
46
+
and then visit [localhost:3000](http://localhost:3000/), we should see a directory listing of the demo app's root. Also, if we visit the [demo app](https://chisel-demo.herokuapp.com) in the browser we should hit the server's default proxy and see a copy of [example.com](http://example.com).
49
47
50
48
### Usage
51
49
@@ -54,7 +52,7 @@ default proxy and see a copy of [example.com](http://example.com).
54
52
55
53
Usage: chisel [command] [--help]
56
54
57
-
Version: X.X.X
55
+
Version: 0.0.0-src
58
56
59
57
Commands:
60
58
server - runs chisel in server mode
@@ -66,6 +64,8 @@ default proxy and see a copy of [example.com](http://example.com).
66
64
```
67
65
</tmpl>
68
66
67
+
`chisel server --help`
68
+
69
69
<tmpl,code: chisel server --help>
70
70
```
71
71
@@ -78,13 +78,22 @@ default proxy and see a copy of [example.com](http://example.com).
78
78
79
79
--port, Defines the HTTP listening port (defaults to 8080).
80
80
81
+
--key, An optional string to seed the generation of a ECC public
82
+
and private key pair. All commications will be secured using this
83
+
key pair. Share the resulting fingerprint with clients to prevent
84
+
man-in-the-middle attacks.
85
+
86
+
--authfile, An optional path to a users.json file. This file should
87
+
be an object with users defined like:
88
+
"<user:pass>": ["<addr-regex>","<addr-regex>"]
89
+
when <user> connects, their <pass> will be verified and then
90
+
each of the remote addresses will be compared against the list
91
+
of address regular expressions for a match. Addresses will
92
+
always come in the form "<host/ip>:<port>".
93
+
81
94
--proxy, Specifies the default proxy target to use when chisel
82
95
receives a normal HTTP request.
83
96
84
-
--key, Enables AES256 encryption and specify the string to
85
-
use to derive the key (derivation is performed using PBKDF2
86
-
with 2048 iterations of SHA256).
87
-
88
97
-v, Enable verbose logging
89
98
90
99
--help, This help text
@@ -95,6 +104,8 @@ default proxy and see a copy of [example.com](http://example.com).
95
104
```
96
105
</tmpl>
97
106
107
+
`chisel client --help`
108
+
98
109
<tmpl,code: chisel client --help>
99
110
```
100
111
@@ -121,9 +132,14 @@ default proxy and see a copy of [example.com](http://example.com).
121
132
122
133
Options:
123
134
124
-
--key, Enables AES256 encryption and specify the string to
125
-
use to derive the key (derivation is performed using PBKDF2
126
-
with 2048 iterations of SHA256).
135
+
--fingerprint, An optional fingerprint (server authentication)
136
+
string to compare against the server's public key. You may provide
137
+
just a prefix of the key or the entire string. Fingerprint
138
+
mismatches will close the connection.
139
+
140
+
--auth, An optional username and password (client authentication)
141
+
in the form: "<user>:<pass>". These credentials are compared to
142
+
the credentials inside the server's --authfile.
127
143
128
144
-v, Enable verbose logging
129
145
@@ -139,13 +155,17 @@ See also [programmatic usage](https://github.com/jpillora/chisel/wiki/Programmat
139
155
140
156
### Security
141
157
142
-
**Beware** The `key` option derives the keys and initialization vectors and is currently susceptible to a sustained targeted attack, this risk will be lessened when the switch SSH is complete.
158
+
Encryption is enabled by default, when you start up a chisel server, it will generate an in-memory ECC public/private key pair. The public key fingerprint will be displayed as the server starts. Instead of always generating a random key, the server may optionally specify a key seed, using the `--key`, which will be used to seed the key generation. When clients connect, they will also display the server's public key fingerprint. The client can force a particular fingerprint using the `--fingerprint` option. See the `--help` above for more information.
159
+
160
+
### Authentication
161
+
162
+
Using the `--authfile` option, the server may optionally provide a `user.json` configuration file to create a list of accepted users. The client then authenticates using the `--auth` option. See [users.json](example/users.json) for an example authentication configuration file. See the `--help` above for more information.
143
163
144
-
It's recommended to use TLS to secure your traffic, which can only be done by hosting your chisel server behind a TLS terminating proxy (like Heroku's router). In the future, the server will allow your to pass in TLS credentials and make use of Go's TLS (HTTPS) server.
164
+
Internally, this is done using the *Password* authentication method provided by SSH. Learn more about `crypto/ssh` here http://blog.gopheracademy.com/go-and-ssh/.
145
165
146
166
### Performance
147
167
148
-
With [crowbar](https://github.com/q3k/crowbar), a connection is tunnelled by repeatedly querying the server with updates. This results in a large amount of HTTP and TCP connection overhead. Chisel overcomes this using WebSockets combined with [Yamux](https://github.com/hashicorp/yamux) to create hundreds of SDPY/HTTP2 like logical connections, resulting in **one** TCP connection per client.
168
+
With [crowbar](https://github.com/q3k/crowbar), a connection is tunnelled by repeatedly querying the server with updates. This results in a large amount of HTTP and TCP connection overhead. Chisel overcomes this using WebSockets combined with [crypto/ssh](https://golang.org/x/crypto/ssh) to create hundreds of logical connections, resulting in **one** TCP connection per client.
149
169
150
170
In this simple benchmark, we have:
151
171
@@ -178,18 +198,18 @@ Note, we're using an in-memory "file" server on localhost for these tests
178
198
`chisel`
179
199
180
200
```
181
-
:2001 => 1 bytes in 1.334661ms
182
-
:2001 => 10 bytes in 807.797µs
183
-
:2001 => 100 bytes in 763.728µs
184
-
:2001 => 1000 bytes in 1.029811ms
185
-
:2001 => 10000 bytes in 840.247µs
186
-
:2001 => 100000 bytes in 1.647748ms
187
-
:2001 => 1000000 bytes in 3.495904ms
188
-
:2001 => 10000000 bytes in 22.298904ms
189
-
:2001 => 100000000 bytes in 255.410448ms
201
+
:2001 => 1 bytes in 1.190288ms
202
+
:2001 => 10 bytes in 1.17237ms
203
+
:2001 => 100 bytes in 821.369µs
204
+
:2001 => 1000 bytes in 1.029366ms
205
+
:2001 => 10000 bytes in 1.281065ms
206
+
:2001 => 100000 bytes in 2.14094ms
207
+
:2001 => 1000000 bytes in 9.538984ms
208
+
:2001 => 10000000 bytes in 86.500426ms
209
+
:2001 => 100000000 bytes in 814.630443ms
190
210
```
191
211
192
-
~100MB in **a quarter of a second**
212
+
~100MB in **0.8 seconds**
193
213
194
214
`crowbar`
195
215
@@ -227,13 +247,16 @@ See more [test/](test/)
227
247
*`github.com/jpillora/chisel/server` contains the server package
228
248
*`github.com/jpillora/chisel/client` contains the client package
229
249
250
+
### Changelog
251
+
252
+
*`1.0.0` - Init
253
+
*`1.1.0` - Swapped out simple symmetric encryption for ECC SSH
0 commit comments