async def METHOD_NAME(
    self, request, subprotocols: Optional[Sequence[str]] = None
):
    # let the websockets package do the handshake with the client
    try:
        if subprotocols is not None:
            # subprotocols can be a set or frozenset,
            # but ServerProtocol needs a list
            subprotocols = cast(
                Optional[Sequence[Subprotocol]],
                list(
                    [
                        Subprotocol(subprotocol)
                        for subprotocol in subprotocols
                    ]
                ),
            )
        ws_proto = ServerProtocol(
            max_size=self.websocket_max_size,
            subprotocols=subprotocols,
            state=OPEN,
            logger=logger,
        )
        resp: "http11.Response" = ws_proto.accept(request)
    except Exception:
        msg = (
            "Failed to open a WebSocket connection.\n"
            "See server log for more information.\n"
        )
        raise SanicException(msg, status_code=500)
    if 100 <= resp.status_code <= 299:
        first_line = (
            f"HTTP/1.1 {resp.status_code} {resp.reason_phrase}\r\n"
        ).encode()
        rbody = bytearray(first_line)
        rbody += (
            "".join([f"{k}: {v}\r\n" for k, v in resp.headers.items()])
        ).encode()
        rbody += b"\r\n"
        if resp.body is not None:
            rbody += resp.body
            rbody += b"\r\n\r\n"
        await super().send(rbody)
    else:
        raise SanicException(resp.body, resp.status_code)
    self.websocket = WebsocketImplProtocol(
        ws_proto,
        ping_interval=self.websocket_ping_interval,
        ping_timeout=self.websocket_ping_timeout,
        close_timeout=self.websocket_timeout,
    )
    loop = (
        request.transport.loop
        if hasattr(request, "transport")
        and hasattr(request.transport, "loop")
        else None
    )
    await self.websocket.connection_made(self, loop=loop)
    return self.websocket