|
1 | 1 | HTTP over SSH |
2 | 2 | ============= |
3 | 3 |
|
4 | | -This dynamic HTTP proxy tunnels your HTTP requests through SSH connections using public key authentication. |
5 | | -It is not recommended for production use. |
| 4 | +This dynamic HTTP proxy tunnels your HTTP requests through SSH connections |
| 5 | +using public key authentication. The intention to develop this program is |
| 6 | +the requirement of polling [Prometheus exporters][promexp] through SSH. |
6 | 7 |
|
7 | | -The intention to develope this program is the requirement of polling [Prometheus exporters](https://prometheus.io/docs/instrumenting/exporters/) through SSH. |
| 8 | +> **It is not recommended for production use, yet.** |
| 9 | +
|
| 10 | +[promexp]: https://prometheus.io/docs/instrumenting/exporters/ |
8 | 11 |
|
9 | 12 | ## Syntax |
10 | 13 |
|
11 | 14 | http://<proxy-address>/<ssh-address>/<destination-host>/<destination-path> |
12 | 15 |
|
13 | 16 |
|
14 | | -## Example |
| 17 | +## Usage |
| 18 | + |
| 19 | +After installation (see below), start the proxy on `localhost:8000`: |
| 20 | + |
| 21 | +```console |
| 22 | +$ http-over-ssh -listen 127.0.0.1:8000 |
| 23 | +``` |
| 24 | + |
| 25 | +For a full list of options run `http-over-ssh -help`. |
| 26 | + |
| 27 | +If you want to fetch http://example.com/index.html via `root@jumphost.tld:22`, |
| 28 | +just fetch this URL instead: |
| 29 | + |
| 30 | + http://localhost:8080/root@jumphost.tld:22/example.com:80/index.html |
| 31 | + |
| 32 | +For `<ssh-address>`, the defaults for username and port are "root" and 22. |
| 33 | +The following fetch URL is hence equivalent: |
| 34 | + |
| 35 | + http://localhost:8080/jumphost.tld/example.com:80/index.html |
| 36 | + |
| 37 | +For the `<destination-host>` is currently only HTTP allowed. This might |
| 38 | +change in the future, but requires a change in the fetch URL syntax. |
15 | 39 |
|
16 | | -Your proxy is reachable at `localhost:8000` and you want to fetch http://example.com/index.html via `jumphost.tld:22`. |
17 | | -Then just fetch: |
| 40 | +Parsing IPv6 addresses for both `<ssh-address>` and `<destination-host>` |
| 41 | +is currently buggy as well. |
18 | 42 |
|
19 | | - http://localhost:8080/jumphost.tld:22/example.com:80/index.html |
| 43 | +Please [open an issue][issues] if you need one those features. |
20 | 44 |
|
| 45 | +[issues]: https://github.com/digineo/http-over-ssh/issues |
| 46 | + |
| 47 | + |
| 48 | +## Installation |
| 49 | + |
| 50 | +If you have the Go toolchain installed, a simple |
| 51 | + |
| 52 | +```console |
| 53 | +$ go get github.com/digineo/http-over-ssh |
| 54 | +``` |
| 55 | + |
| 56 | +will place a `http-over-ssh` binary in `$GOPATH/bin/`. |
| 57 | + |
| 58 | +Alternatively, you may download a pre-built binary from the Github |
| 59 | +[release page][releases] and extract the binary into your `$PATH`. |
| 60 | + |
| 61 | +[releases]: https://github.com/digineo/http-over-ssh/releases |
21 | 62 |
|
22 | 63 | ## Next steps |
23 | 64 |
|
24 | 65 | - [ ] stability improvements |
25 | 66 | - [ ] clean up idle ssh connections |
26 | 67 | - [ ] support for unix sockets |
| 68 | + |
| 69 | +## License |
| 70 | + |
| 71 | +MIT Licence. Copyright 2018, Digineo GmbH |
0 commit comments