forked from alash3al/httpsify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
23 lines (18 loc) · 687 Bytes
/
main.go
File metadata and controls
23 lines (18 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main
import "github.com/fatih/color"
func main() {
colorize(color.FgGreen, "⇛ Parsing the specified flags ...")
InitFlags()
colorize(color.FgGreen, "⇛ Loading the provided json hosts file from ("+*HOSTS_FILE+") ...")
if err := InitHostsList(); err != nil {
colorize(color.FgRed, "⇛", err.Error())
return
}
colorize(color.FgGreen, "⇛ Watching the hosts file for any change to hot reload it ...")
go func() {
WatchChanges()
}()
colorize(color.FgGreen, "⇛ Running the HTTP server on address ("+*HTTP_ADDR+") ...")
colorize(color.FgGreen, "⇛ Running the HTTPS (HTTP/2) server on address ("+*HTTPS_ADDR+") ...")
colorize(color.FgRed, InitServer())
}