Skip to content
This repository was archived by the owner on Apr 25, 2024. It is now read-only.

Commit ab15bfe

Browse files
committed
Add README
1 parent f5ebcf1 commit ab15bfe

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# dirhttps
2+
3+
Spinning up an HTTPS server from current directory - the TLS equivalent of `python -m http.server`.
4+
5+
## Install
6+
7+
Use [prebuilt binaries](https://github.com/maetthu/dirhttps/releases)
8+
9+
or build from source
10+
11+
```
12+
go get -u github.com/maetthu/dirhttps
13+
$(go env GOPATH)/bin/dirhttps
14+
```
15+
16+
## Setup
17+
18+
_dirhttps_ needs a certificate and corresponding key to operate. Easiest option is to use the excellent [mkcert](https://github.com/FiloSottile/mkcert) tool which creates locally trusted, self-signed development certificates.
19+
20+
* Install and setup mkcert CA
21+
* Create dirhttps certificate
22+
23+
```
24+
$ mkdir ~/.config/dirhttps
25+
$ cd ~/.config/dirhttps
26+
$ mkcert -cert-file cert.pem -key-file key.pem localhost 127.0.0.1 more.hostnames.or.ips.if.needed.example.org
27+
```
28+
29+
* Done
30+
31+
## Usage
32+
33+
```
34+
$ cd /tmp
35+
$ dirhttps
36+
2019/03/31 13:40:26 Listening for HTTPS connections on :8443
37+
2019/03/31 13:40:26 Serving from directory /tmp
38+
```
39+
40+
### Different listening address/port
41+
42+
```
43+
$ dirhttps -l :1234
44+
$ dirhttps -l 127.0.0.2:8443
45+
```
46+

0 commit comments

Comments
 (0)