title: middleware with WebSocketChannel
body: <p>I can't use handle handleAuth middleware with websocket connection even it works well with other connections
  with web socket it gives &quot;hijack exception&quot;
  is there any way to handle websocket connections with shelf library
  thanks in advance</p>
  <p>the exception</p>
  <pre><code>HijackException (A shelf request's underlying data stream was hijacked.
  This exception is used for control flow and should only be handled by a shelf adapter.)
  </code></pre>
  <p>the code</p>
  <pre><code>  final router = Router();
   
  
    
    router.mount('/auth/', AuthApi().handler);
  
    router.mount('/ws/', webSocketHandler((webSocket) {
      webSocket.stream.listen((message) {
        webSocket.sink.add(&quot;echo $message&quot;);
      });
    }));
  
  
    final handler = const shelf.Pipeline()
        .addMiddleware(shelf.logRequests())
        .addMiddleware(handleAuth(Env.secretKey, tokenService))
        .addHandler(router);
  
    final server = await io.serve(handler, address.address, port);
  
  
  
  ......
  
  
  Middleware handleAuth(String secret, TokenService tokenService) {
    return (Handler innerHandler) {
      return (Request request) async {
        final authHeader = request.headers['authorization'];
        var token, jwt;
        Request? updateRequest;
        if (authHeader != null &amp;&amp; authHeader.startsWith('Bearer ')) {
          token = authHeader.substring(7);
          jwt = verifyJwt(token, secret);
          if (jwt is! JWT) {
            return Response(400, body: &quot;Invalid login Token&quot;);
          }
          final dbId = tokenService.getDBId(authHeader.substring(7));
          updateRequest =
              request.change(context: {'authDetails': jwt, 'userId': dbId});
        }
        return await innerHandler(updateRequest ?? request);
      };
    };
  }
  </code></pre>