server.go
func (s *Server) MiddlewareFunc(middleware ...func(ctx *ReqCtx) error) {
	s.middleware = append(s.middleware, middleware...)
}
func (s *Server) MiddlewareFunc(middleware ...func(ctx *ReqCtx) error) {
	s.middleware = append(s.middleware, middleware...)
}
// MiddlewareFunc registers middleware function to handle incoming request messages.