gopher listener
This commit is contained in:
parent
596b486544
commit
af11b39459
1 changed files with 5 additions and 2 deletions
|
@ -24,10 +24,13 @@ import (
|
||||||
|
|
||||||
func initGopher(apper Apper) {
|
func initGopher(apper Apper) {
|
||||||
handler := NewWFHandler(apper)
|
handler := NewWFHandler(apper)
|
||||||
|
|
||||||
gopher.HandleFunc("/", handler.Gopher(handleGopher))
|
gopher.HandleFunc("/", handler.Gopher(handleGopher))
|
||||||
log.Info("Serving on gopher://localhost:%d", apper.App().Config().Server.GopherPort)
|
log.Info("Serving on gopher://localhost:%d", apper.App().Config().Server.GopherPort)
|
||||||
gopher.ListenAndServe(fmt.Sprintf(":%d", apper.App().Config().Server.GopherPort), nil)
|
listener, err := Listen("tcp", fmt.Sprintf("%s:%d", apper.App().Config().Server.Bind, apper.App().Config().Server.GopherPort))
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
gopher.Serve(listener, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Utility function to strip the URL from the hostname provided by app.cfg.App.Host
|
// Utility function to strip the URL from the hostname provided by app.cfg.App.Host
|
||||||
|
|
Loading…
Add table
Reference in a new issue