class documentation

A WebSocketClientEndpoint describes an URL to connect to and a way of connecting to that URL, that can connect a WebSocketClientFactory to that URL.

Class Method new Construct a WebSocketClientEndpoint from a reactor and a URL.
Async Method connect Make an outgoing connection to this WebSocketClientEndpoint's HTTPS connection.
Class Variable endpointFactory an IAgentEndpointFactory that constructs agent endpoints when connect
Class Variable url the URL to connect to.
@classmethod
def new(cls, reactor: IReactorTCP, url: str, tlsPolicy: IPolicyForHTTPS = BrowserLikePolicyForHTTPS(), connectTimeout: int | None = None, bindAddress: bytes | None = None) -> WebSocketClientEndpoint: (source)

Construct a WebSocketClientEndpoint from a reactor and a URL.

Parameters
reactor:IReactorTCPThe reactor to use for the TCP connection.
url:stra string describing an URL where a websocket server lives.
tlsPolicy:IPolicyForHTTPSThe TLS policy to use for HTTPS connections.
connectTimeout:int | NoneThe number of seconds for the TCP-level connection timeout.
bindAddress:bytes | NoneThe bind address to use for the TCP client connections.
Returns
WebSocketClientEndpointthe newly constructed endpoint.
async def connect(self, protocolFactory: WebSocketClientFactory[_WSP]) -> _WSP: (source)

Make an outgoing connection to this WebSocketClientEndpoint's HTTPS connection.

Parameters
protocolFactory:WebSocketClientFactory[_WSP]The constructor for the protocol.
Returns
_WSPA coroutine (that yields Deferreds) that completes with the connected WebSocketProtocol once the websocket connection is established.
endpointFactory: IAgentEndpointFactory = (source)

an IAgentEndpointFactory that constructs agent endpoints when connect

url: str = (source)

the URL to connect to.