Part of twisted.internet.endpoints View Source
Construct a client endpoint from a description string.
Client description strings are much like server description strings, although they take all of their arguments as keywords, since even the simplest client endpoint (plain TCP) requires at least 2 arguments (host and port) to construct.
You can create a TCP client endpoint with the 'host' and 'port' arguments, like so:clientFromString(reactor, "tcp:host=www.example.com:port=80")or an SSL client endpoint with those arguments, plus the arguments used by the server SSL, for a client certificate:
clientFromString(reactor, "ssl:host=web.example.com:port=443:" "privateKey=foo.pem:certKey=foo.pem")to specify your certificate trust roots, you can identify a directory with PEM files in it with the
caCertsDir
argument:
clientFromString(reactor, "ssl:host=web.example.com:port=443:" "caCertsDir=/etc/ssl/certs")This function is also extensible; new endpoint types may be registered as
IStreamClientEndpointStringParser
plugins. See that interface for more information.
Parameters | reactor | The client endpoint will be constructed with this reactor. |
description | The strports description to parse. | |
Returns | A new endpoint which can be used to connect with the parameters given by
by description .
(type: IStreamClientEndpoint
) | |
Present Since | 10.2 |