// StartBackground function starts a webserver from a goroutine
// addr describe where this webserver will listen for connections
StartBackground function starts a webserver from a goroutine
addr describe where this webserver will listen for connections
// StartBackground function starts a webserver from a goroutine // addr describe where this webserver will listen for connections
func (s *Server) StartBackground(addr string) {
	s.mux = http.NewServeMux()
	s.srv = &http.Server{
		Addr:    addr,
		Handler: s.mux,
	}
	s.upgrader = websocket.Upgrader{}
	s.mux.HandleFunc("/", s.handler)
	s.mux.HandleFunc("/ws/", s.handlerWS)
	go func() {
		err := s.srv.ListenAndServe()
		if err == nil {
			log.Println("httpipe closes")
		}
	}()
	time.Sleep(time.Millisecond * 100)
}
func ( s * Server ) StartBackground ( addr string ) { s . mux = http . NewServeMux ( ) s . srv = & http . Server { Addr : addr , Handler : s . mux , } s . upgrader = websocket . Upgrader { } s . mux . HandleFunc ( " " , s . handler ) s . mux . HandleFunc ( " " , s . handlerWS ) go func ( ) { err := s . srv . ListenAndServe ( ) if err == nil { log . Println ( " " ) } } ( ) time . Sleep ( time . Millisecond * 100 ) }
StartBackground function starts a webserver from a goroutine
addr describe where this webserver will listen for connections
StartBackground function starts a webserver from a goroutine addr describe where this webserver will listen for connections