-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathgpanel.go
34 lines (26 loc) · 900 Bytes
/
gpanel.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
25
26
27
28
29
30
31
32
33
34
package main
import (
"log"
"net/http"
"strconv"
"github.com/kentonh/gPanel/pkg/gpserver"
"github.com/kentonh/gPanel/pkg/router"
)
func main() {
const serverPort = 2082
const insecurePort = 2080
const securePort = 2443
server, err := gpserver.New()
if err != nil {
log.Printf("\nA non-fatal error has occurred whilst starting the server: %v\n\n", err.Error())
}
router := router.New(insecurePort, securePort)
if router == nil {
log.Fatal("Error starting router")
}
router.Start()
log.Print("To Exit: CTRL+C")
log.Print("Domain router is listening on localhost:" + strconv.Itoa(insecurePort) + " (HTTP) and localhost:" + strconv.Itoa(securePort) + " (HTTPS)")
log.Print("gPanel Server is listening on localhost:" + strconv.Itoa(serverPort) + ", serving out of the server/document_root/ directory...")
http.ListenAndServe("localhost:"+strconv.Itoa(serverPort), server)
}