-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
38 lines (34 loc) · 1.4 KB
/
main.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
35
36
37
38
package main
import (
"fmt"
"gateway/app"
"gateway/myhttp"
"github.com/fatih/color"
"log"
"net/http"
)
//http://patorjk.com/software/taag/#p=display&f=Bloody&t=gateway
//http://patorjk.com/software/taag/#p=display&f=3D-ASCII&t=gateway
var banner string = `
________ ________ _________ _______ ___ __ ________ ___ ___
|\ ____\|\ __ \|\___ ___\\ ___ \ |\ \ |\ \|\ __ \ |\ \ / /|
\ \ \___|\ \ \|\ \|___ \ \_\ \ __/|\ \ \ \ \ \ \ \|\ \ \ \ \/ / /
\ \ \ __\ \ __ \ \ \ \ \ \ \_|/_\ \ \ __\ \ \ \ __ \ \ \ / /
\ \ \|\ \ \ \ \ \ \ \ \ \ \ \_|\ \ \ \|\__\_\ \ \ \ \ \ \/ / /
\ \_______\ \__\ \__\ \ \__\ \ \_______\ \____________\ \__\ \__\__/ / /
\|_______|\|__|\|__| \|__| \|_______|\|____________|\|__|\|__|\___/ /
\|___|/
`
func init() {
color.Cyan(banner)
app.InitConfig()
color.Cyan("GateWay initialized with port(s): %s", app.Config.Port)
}
func main() {
// handle all requests to your server using the proxy
http.HandleFunc("/", myhttp.ProxyRequestHandler)
http.HandleFunc(app.Config.Login, myhttp.LoginHandle)
http.HandleFunc(app.Config.Code, myhttp.GenerateCaptchaHandler)
//http.HandleFunc("/verify", myhttp.CaptchaVerifyHandle)
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", app.Config.Port), nil))
}