async def METHOD_NAME(
    cls: Type["Transport"],
    stream: Stream,
    host: str,
    keepalive: int | None = None,
) -> "Transport":
    ws = WSConnection(ConnectionType.CLIENT)
    transport = cls(stream, ws, keepalive)
    # Because this is a client WebSocket, we need to initiate the connection
    # handshake by sending a Request event.
    await transport._net_send(
        Request(
            host=host,
            target=TRANSPORT_TARGET,
            extra_headers=[(b"User-Agent", USER_AGENT.encode())],
        )
    )
    # Get handshake answer
    event = await transport._next_ws_event()
    if isinstance(event, AcceptConnection):
        transport.logger.debug("WebSocket negotiation complete", ws_event=event)
    else:
        transport.logger.warning("Unexpected event during WebSocket handshake", ws_event=event)
        reason = f"Unexpected event during WebSocket handshake: {event}"
        raise TransportError(reason)
    return transport