remove unnecessary handler
This commit is contained in:
parent
e7f996607d
commit
e2f74b6ba5
12
main.go
12
main.go
|
@ -32,19 +32,13 @@ func main() {
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
|
||||||
srv := NewCaptureService(config.MaxCaptures)
|
srv := NewCaptureService(config.MaxCaptures)
|
||||||
handler := NewRecorderHandler(srv, NewPluginHandler(NewProxyHandler(config.TargetURL)))
|
hdr := NewRecorderHandler(srv, NewPluginHandler(NewProxyHandler(config.TargetURL)))
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
fmt.Println(http.ListenAndServe(":"+config.DashboardPort, NewDashboardHandler(handler, srv, config)))
|
fmt.Println(http.ListenAndServe(":"+config.DashboardPort, NewDashboardHandler(hdr, srv, config)))
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}()
|
}()
|
||||||
fmt.Println(http.ListenAndServe(":"+config.ProxyPort, NewCaptureHandler(handler)))
|
fmt.Println(http.ListenAndServe(":"+config.ProxyPort, hdr))
|
||||||
}
|
|
||||||
|
|
||||||
func NewCaptureHandler(h http.HandlerFunc) http.Handler {
|
|
||||||
router := http.NewServeMux()
|
|
||||||
router.HandleFunc("/", h)
|
|
||||||
return router
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDashboardHandler(h http.HandlerFunc, srv *CaptureService, config Config) http.Handler {
|
func NewDashboardHandler(h http.HandlerFunc, srv *CaptureService, config Config) http.Handler {
|
||||||
|
|
Loading…
Reference in a new issue