wsResponder method

Route wsResponder(
  1. String path,
  2. WsOnConnect onConnect, {
  3. Map<String, String>? pathRegEx,
  4. List<RouteInterceptor>? after,
  5. List<RouteInterceptor>? before,
  6. List<ExceptionHandler>? onException,
})

Example: server.wsEcho('/ws');

Implementation

Route wsResponder(
    String path, WsOnConnect /* < WsResponder | Response > */ onConnect,
    {Map<String, String>? pathRegEx,
    List<RouteInterceptor>? after,
    List<RouteInterceptor>? before,
    List<ExceptionHandler>? onException}) {
  return addRoute(Route.get(path, ws.wsRespond(onConnect),
      pathRegEx: pathRegEx,
      before: before,
      after: after,
      onException: onException));
}