remove unnecessary handler

This commit is contained in:
Fabricio 2019-11-10 14:43:02 -03:00
parent e7f996607d
commit e2f74b6ba5

12
main.go
View file

@ -32,19 +32,13 @@ func main() {
fmt.Println()
srv := NewCaptureService(config.MaxCaptures)
handler := NewRecorderHandler(srv, NewPluginHandler(NewProxyHandler(config.TargetURL)))
hdr := NewRecorderHandler(srv, NewPluginHandler(NewProxyHandler(config.TargetURL)))
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)
}()
fmt.Println(http.ListenAndServe(":"+config.ProxyPort, NewCaptureHandler(handler)))
}
func NewCaptureHandler(h http.HandlerFunc) http.Handler {
router := http.NewServeMux()
router.HandleFunc("/", h)
return router
fmt.Println(http.ListenAndServe(":"+config.ProxyPort, hdr))
}
func NewDashboardHandler(h http.HandlerFunc, srv *CaptureService, config Config) http.Handler {