title: Wrapping socketio service in http route handler
body: <p>I have a small web server written in go, with http routers, i am trying to wrap a route to a handler that runs a socket.io service, i am not too familiar with socket.io, so i maybe doing something wrong. When i visit my endpoint via browser "localhost:5001/socketio" i am receiving "invalid transport" and getting a "400" in addition the my html isn't being presented on the page which being handled in a separate router.handle , my code, looks like the socketio service isn't even starting:</p>
  
  <p>servio handler</p>
  
  <pre><code>func socketio() *socket.Server {
  
  serverio, err := socketio.NewServer(nil)
  if err != nil {
      log.Fatal(err)
  }
  
  serverio.On("connection", func(so socketio.Socket) {
  
      log.Println("on connection")
  
      so.Join("chat")
  
      so.On("chat message", func(msg string) {
          log.Println("emit:", so.Emit("chat message", msg))
          so.BroadcastTo("chat", "chat message", msg)
      })
  
      so.On("disconnection", func() {
          log.Println("on disconnect")
      })
  })
  
  serverio.On("error", func(so socketio.Socket, err error) {
      log.Println("error:", err)
  })
  
  return serverio
  }
  </code></pre>
  
  <p>router code</p>
  
  <pre><code>func newRouter() *http.ServeMux {
      router := http.NewServeMux()
  
  
      router.Handle("/socketio", socketio())
      router.Handle("/", http.FileServer(http.Dir("./asset")))
  
      return router
  
  }
  </code></pre>