@@ -104,18 +104,39 @@ It helps with establishing a plain TCP/IP or secure SSL/TLS connection to the AM
104104and issuing an initial ` login ` action.
105105
106106``` php
107- $factory->createClient('user:secret@localhost' )->then(
107+ $factory->createClient($amiUrl )->then(
108108 function (Client $client) {
109- // client connected and authenticated
109+ // client connected ( and authenticated)
110110 },
111111 function (Exception $e) {
112112 // an error occured while trying to connect or authorize client
113113 }
114114);
115115```
116116
117- > Note: The given $amiUrl * must* include a host, it * should* include a username and secret
118- > and it * can* include a scheme (tcp/ssl) and port definition.
117+ The ` $amiUrl ` contains the host and optional port to connect to:
118+
119+ ``` php
120+ $factory->createClient('127.0.0.1:5038');
121+ ```
122+
123+ > If the ` $amiUrl ` is ` null ` (or omitted) this method defaults to connecting
124+ to your local host (` 127.0.0.1:5038 ` ).
125+
126+ The above examples to not pass any authentication details, so you may have to
127+ call ` ActionSender::login() ` after connecting or use the recommended shortcut
128+ to pass a username and secret for your AMI login details like this:
129+
130+ ``` php
131+ $factory->createClient('user:secret@localhost');
132+ ```
133+
134+ The ` Factory ` defaults to establishing a plaintext TCP connection.
135+ If you want to connect through a secure TLS proxy, you can use the ` tls ` scheme:
136+
137+ ``` php
138+ $factory->createClient('tls://user:secret@localhost:12345');
139+ ```
119140
120141### Client
121142
0 commit comments