v0.6.0
版本发布时间: 2016-11-29 14:23:12
clue/reactphp-socks最新发布版本:v1.4.0(2022-08-31 22:43:41)
-
Feature / BC break: Pass connector into
Client
instead of loop, remove unneeded deps (#49 by @clue)// old (connector is create implicitly) $client = new Client('127.0.0.1', $loop); // old (connector can optionally be passed) $client = new Client('127.0.0.1', $loop, $connector); // new (connector is now mandatory) $connector = new React\SocketClient\TcpConnector($loop); $client = new Client('127.0.0.1', $connector);
-
Feature / BC break:
Client
now implementsConnectorInterface
, removeConnector
adapter (#47 by @clue)// old (explicit connector functions as an adapter) $connector = $client->createConnector(); $promise = $connector->create('google.com', 80); // new (client can be used as connector right away) $promise = $client->create('google.com', 80);
-
Feature / BC break: Remove
createSecureConnector()
, useSecureConnector
instead (#47 by @clue)// old (tight coupling and hidden dependency) $tls = $client->createSecureConnector(); $promise = $tls->create('google.com', 443); // new (more explicit, loose coupling) $tls = new React\SocketClient\SecureConnector($client, $loop); $promise = $tls->create('google.com', 443);
-
Feature / BC break: Remove
setResolveLocal()
and local DNS resolution and default to remote DNS resolution, useDnsConnector
instead (#44 by @clue)// old (implicitly defaults to true, can be disabled) $client->setResolveLocal(false); $tcp = $client->createConnector(); $promise = $tcp->create('google.com', 80); // new (always disabled, can be re-enabled like this) $factory = new React\Dns\Resolver\Factory(); $resolver = $factory->createCached('8.8.8.8', $loop); $tcp = new React\SocketClient\DnsConnector($client, $resolver); $promise = $tcp->create('google.com', 80);
-
Feature / BC break: Remove
setTimeout()
, useTimeoutConnector
instead (#45 by @clue)// old (timeout only applies to TCP/IP connection) $client = new Client('127.0.0.1', …); $client->setTimeout(3.0); $tcp = $client->createConnector(); $promise = $tcp->create('google.com', 80); // new (timeout can be added to any layer) $client = new Client('127.0.0.1', …); $tcp = new React\SocketClient\TimeoutConnector($client, 3.0, $loop); $promise = $tcp->create('google.com', 80);
-
Feature / BC break: Remove
setProtocolVersion()
andsetAuth()
mutators, only support SOCKS URI for protocol version and authentication (immutable API) (#46 by @clue)// old (state can be mutated after instantiation) $client = new Client('127.0.0.1', …); $client->setProtocolVersion('5'); $client->setAuth('user', 'pass'); // new (immutable after construction, already supported as of v0.5.2 - now mandatory) $client = new Client('socks5://user:pass@127.0.0.1', …);