mirror of
https://github.com/foomo/gofoomo.git
synced 2025-10-16 12:25:44 +00:00
added *proxy.ListenAndServeWithHandler to make it easier to wrap things
This commit is contained in:
parent
50b5113a9e
commit
b860b267fb
@ -114,9 +114,17 @@ func NewServer(config *Config) (p *Server, err error) {
|
||||
return p, nil
|
||||
}
|
||||
|
||||
func (p *Server) ListendAndServe() error {
|
||||
return p.listenAndServeWithHandler(p.Proxy)
|
||||
}
|
||||
|
||||
func (p *Server) ListenAndServeWithHandler(handler http.Handler) error {
|
||||
return p.listenAndServeWithHandler(handler)
|
||||
}
|
||||
|
||||
// ListenAndServe until things go bad, depending upon configuration this will\
|
||||
// listen to http and https requests
|
||||
func (p *Server) ListenAndServe() error {
|
||||
func (p *Server) listenAndServeWithHandler(handler http.Handler) error {
|
||||
c := p.Config.Server
|
||||
errorChan := make(chan error)
|
||||
startedHTTPS := false
|
||||
|
||||
Loading…
Reference in New Issue
Block a user