main.go 599 B

12345678910111213141516171819202122
  1. package main
  2. import "github.com/fatih/color"
  3. func main() {
  4. colorize(color.FgGreen, "⇛ Parsing the specified flags ...")
  5. InitFlags()
  6. colorize(color.FgGreen, "⇛ Loading the provided json hosts file from ("+*HOSTS_FILE+") ...")
  7. if err := InitHostsList(); err != nil {
  8. colorize(color.FgRed, "⇛", err.Error())
  9. return
  10. }
  11. colorize(color.FgGreen, "⇛ Watching the hosts file for any change to hot reload it ...")
  12. go func() {
  13. WatchChanges()
  14. }()
  15. colorize(color.FgGreen, "⇛ Running the HTTPS (HTTP/2) server on address ("+*HTTPS_ADDR+") ...")
  16. colorize(color.FgRed, InitServer())
  17. }