ws method

Route ws (String path, { Map<String, String> pathRegEx, WsHandler handler, FutureOr onConnect(Context ctx, WebSocket ws), WsResultProcessor resultProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })

Example: server.ws('/ws', (String data) => int.parse(data) + 1);

Implementation

Route ws(String path,
    {Map<String, String> pathRegEx,
    WsHandler handler,
    FutureOr onConnect(Context ctx, WebSocket ws),
    WsResultProcessor resultProcessor,
    List<RouteInterceptor> after,
    List<RouteInterceptor> before,
    List<ExceptionHandler> onException}) {
  return addRoute(Route.get(
      path,
      wsHandler(
          handler: handler,
          onConnect: onConnect,
          resultProcessor: resultProcessor),
      pathRegEx: pathRegEx,
      before: before,
      after: after,
      onException: onException));
}