-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathvars.go
24 lines (20 loc) · 948 Bytes
/
vars.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main
import (
"flag"
"path"
"sync/atomic"
"github.com/mitchellh/go-homedir"
"golang.org/x/crypto/acme/autocert"
)
var (
homeDir, _ = homedir.Dir()
hosts = atomic.Value{}
)
var (
flagHTTPSAddr = flag.String("https", ":443", "the port to listen for https requests on, it is recommended to leave it as is")
flagHTTPAddr = flag.String("http", ":80", "the port to listen for http requests on, it is recommended to leave it as is")
flagAutocertCacheDir = flag.String("certs", path.Join(homeDir, ".httpsify/certs"), "the certs directory")
flagHostsFile = flag.String("hosts", path.Join(homeDir, ".httpsify/hosts.json"), "the file containing hosts mappings to upstreams")
flagACMEDirectory = flag.String("acme-directory", autocert.DefaultACMEDirectory, "the server to request certificates from")
flagSendXSecuredBy = flag.Bool("x-secured-by", true, "whether to enable x-secured-by header or not")
)