Skip to content

Releases: reactphp-legacy/socket-client

v0.7.0

02 Apr 20:33
Compare
Choose a tag to compare
  • Feature / BC break: Add main Connector facade
    (#93 by @clue)

    The new Connector class acts as a facade for all underlying connectors,
    which are now marked as "advanced usage", but continue to work unchanged.
    This now makes it trivially easy to create plaintext TCP/IP, secure TLS and
    Unix domain socket (UDS) connection streams simply like this:

    $connector = new Connector($loop);
    
    $connector->connect('tls://google.com:443')->then(function (ConnectionInterface $conn) {
        $conn->write("GET / HTTP/1.0\r\n\r\n");
    });

    Optionally, it accepts options to configure all underlying connectors, such
    as using a custom DNS setup, timeout values and disabling certain protocols
    and much more. See the README for more details.

v0.6.2

17 Mar 14:01
Compare
Choose a tag to compare
  • Feature / Fix: Support SNI on legacy PHP < 5.6 and add documentation for
    supported PHP and HHVM versions.
    (#90 and #91 by @clue)

v0.6.1

10 Mar 07:47
Compare
Choose a tag to compare
  • Feature: Forward compatibility with Stream v0.5 and upcoming v0.6
    (#89 by @clue)

  • Fix: Fix examples to use updated API
    (#88 by @clue)

v0.6.0

17 Feb 15:18
Compare
Choose a tag to compare
  • Feature / BC break: Use connect($uri) instead of create($host, $port)
    and resolve with a ConnectionInterface instead of Stream
    and expose remote and local addresses through this interface
    and remove superfluous and undocumented ConnectionException.
    (#74, #82 and #84 by @clue)

    // old
    $connector->create('google.com', 80)->then(function (Stream $conn) {
        echo 'Connected' . PHP_EOL;
        $conn->write("GET / HTTP/1.0\r\n\r\n");
    });
    
    // new
    $connector->connect('google.com:80')->then(function (ConnectionInterface $conn) {
        echo 'Connected to ' . $conn->getRemoteAddress() . PHP_EOL;
        $conn->write("GET / HTTP/1.0\r\n\r\n");
    });

    Note that both the old Stream and the new ConnectionInterface implement
    the same underlying DuplexStreamInterface, so their streaming behavior is
    actually equivalent.
    In order to upgrade, simply use the new typehints.
    Existing stream handlers should continue to work unchanged.

  • Feature / BC break: All connectors now MUST offer cancellation support.
    You can now rely on getting a rejected promise when calling cancel() on a
    pending connection attempt.
    (#79 by @clue)

    // old: promise resolution not enforced and thus unreliable
    $promise = $connector->create($host, $port);
    $promise->cancel();
    $promise->then(/* MAY still be called */, /* SHOULD be called */);
    
    // new: rejecting after cancellation is mandatory
    $promise = $connector->connect($uri);
    $promise->cancel();
    $promise->then(/* MUST NOT be called */, /* MUST be called */);

    Note that this behavior is only mandatory for pending connection attempts.
    Once the promise is settled (resolved), calling cancel() will have no effect.

  • BC break: All connector classes are now marked final
    and you can no longer extend them
    (which was never documented or recommended anyway).
    Please use composition instead of extension.
    (#85 by @clue)

v0.5.3

24 Dec 11:22
Compare
Choose a tag to compare
  • Fix: Skip IPv6 tests if not supported by the system
    (#76 by @clue)
  • Documentation for ConnectorInterface
    (#77 by @clue)

v0.5.2

19 Dec 23:25
Compare
Choose a tag to compare
  • Feature: Replace SecureStream with unlimited read buffer from react/stream v0.4.5
    (#72 by @clue)
  • Feature: Add examples
    (#75 by @clue)

v0.4.6

06 Dec 10:55
Compare
Choose a tag to compare

This is a bugfix release that resolves an issue introduced in the v0.4.5 release.
You should consider upgrading to the v0.5 release.

  • Fix: Always create empty stream context to prevent race condition leading to
    CN mismatch on TLS enabled connections (#73 by @WyriHaximus)

v0.5.1

20 Nov 00:12
Compare
Choose a tag to compare
  • Feature: Support Promise cancellation for all connectors
    (#71 by @clue)

    $promise = $connector->create($host, $port);
    
    $promise->cancel();
  • Feature: Add TimeoutConnector decorator
    (#51 by @clue)

    $timeout = new TimeoutConnector($connector, 3.0, $loop);
    $timeout->create($host, $port)->then(function(Stream $stream) {
        // connection resolved within 3.0s
    });

v0.4.5

27 Mar 18:32
Compare
Choose a tag to compare

This is a compatibility release that backports some changes from the v0.5
release branch. You should consider upgrading to the v0.5 release.

  • Fix: PHP 5.6+ uses new SSL/TLS context options backported (#65 by @clue)
  • Fix: Move SSL/TLS context options to SecureConnector (#43 by @clue)

v0.5.0

19 Mar 13:12
Compare
Choose a tag to compare
  • Feature / BC break: Support Connector without DNS
    (#46 by @clue)

    BC break: The Connector class now serves as a BC layer only.
    The TcpConnector and DnsConnector classes replace its functionality.
    If you're merely using this class, then you're recommended to upgrade as
    per the below snippet – existing code will still work unchanged.
    If you're extending the Connector (generally not recommended), then you
    may have to rework your class hierarchy.

    // old (still supported, but marked deprecated)
    $connector = new Connector($loop, $resolver);
    
    // new equivalent
    $connector = new DnsConnector(new TcpConnector($loop), $resolver);
    
    // new feature: supports connecting to IP addresses only
    $connector = new TcpConnector($loop);
  • Feature: Add socket and SSL/TLS context options to connectors
    (#52 by @clue)

  • Fix: PHP 5.6+ uses new SSL/TLS context options
    (#61 by @clue)

  • Fix: Move SSL/TLS context options to SecureConnector
    (#43 by @clue)

  • Fix: Fix error reporting for invalid addresses
    (#47 by @clue)

  • Fix: Close stream resource if connection fails
    (#48 by @clue)

  • First class support for PHP 5.3 through PHP 7 and HHVM
    (#53, #54 by @clue)

  • Add integration tests for SSL/TLS sockets
    (#62 by @clue)