@@ -19,13 +19,8 @@ include_once __DIR__.'/vendor/autoload.php';
1919
2020$loop = React\EventLoop\Factory::create();
2121
22- // use google's dns servers
23- $dnsResolverFactory = new React\Dns\Resolver\Factory();
24- $dns = $dnsResolverFactory->createCached('8.8.8.8', $loop);
25-
2622// create SOCKS client which communicates with SOCKS server 127.0.0.1:9050
27- $factory = new Clue\React\Socks\Factory($loop, $dns);
28- $client = $factory->createClient('127.0.0.1', 9050);
23+ $client = new Clue\React\Socks\Client($loop, '127.0.0.1', 9050);
2924
3025// now work with your $client, see below
3126
@@ -34,7 +29,7 @@ $loop->run();
3429
3530### Tunnelled TCP connections
3631
37- The ` Socks/ Client` uses a [ Promise] ( https://github.com/reactphp/promise ) -based interface which makes working with asynchronous functions a breeze.
32+ The ` Client ` uses a [ Promise] ( https://github.com/reactphp/promise ) -based interface which makes working with asynchronous functions a breeze.
3833Let's open up a TCP [ Stream] ( https://github.com/reactphp/stream ) connection and write some data:
3934``` PHP
4035$tcp = $client->createConnector();
@@ -223,7 +218,7 @@ If you already have an SSH server set up, you can easily use it as a SOCKS tunne
223218` $ ssh -D 9050 ssh-server `
224219
225220``` PHP
226- $client = $factory->createClient( '127.0.0.1', 9050);
221+ $client = new Client($loop, '127.0.0.1', 9050);
227222```
228223
229224### Using the Tor (anonymity network) to tunnel SOCKS connections
@@ -232,7 +227,7 @@ The [Tor anonymity network](http://www.torproject.org) client software is design
232227
233228``` PHP
234229
235- $client = $factory->createClient( '127.0.0.1', 9050);
230+ $client = new Client($loop, '127.0.0.1', 9050);
236231$client->setResolveLocal(false);
237232```
238233
0 commit comments