MCPcopy
hub / github.com/bettercap/bettercap / Start

Method Start

modules/http_server/http_server.go:107–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105}
106
107func (mod *HttpServer) Start() error {
108 if err := mod.Configure(); err != nil {
109 return err
110 }
111
112 return mod.SetRunning(true, func() {
113 var err error
114 mod.Info("starting on http://%s", mod.server.Addr)
115 if err = mod.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
116 mod.Error("%v", err)
117 mod.Stop()
118 }
119 })
120}
121
122func (mod *HttpServer) Stop() error {
123 return mod.SetRunning(false, func() {

Callers 1

NewHttpServerFunction · 0.95

Calls 5

ConfigureMethod · 0.95
StopMethod · 0.95
SetRunningMethod · 0.80
InfoMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected