Skip to content

Commit e6f5d00

Browse files
committed
Export Handler so it can be used directly
1 parent 699199b commit e6f5d00

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/server.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ func (s *Server) Method(n string, h MethodHandler) {
3131
}
3232

3333
func (s *Server) Listen(ipPort string) {
34-
http.HandleFunc("/websocket", s.handler)
34+
http.HandleFunc("/websocket", s.Handler)
3535
http.ListenAndServe(ipPort, nil)
3636
}
3737

38-
// create websocket connection from http handler and runs the websocket handler
39-
func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
38+
func (s *Server) Handler(w http.ResponseWriter, r *http.Request) {
4039
ws, err := s.upgrader.Upgrade(w, r, nil)
4140

4241
if err != nil {

0 commit comments

Comments
 (0)