Skip to content

Return Connection object which exposes remote address #44

Closed

Description

@clue

Each connector currently resolves with a Stream instance from the react/stream component. We should look into resolving with a Connection instance (which likely extends the Stream class) which should expose the remote address like this:

$connector->create('google.com', 80)->then(function (Connection $conn) {
    echo 'connected to ' . $conn->getRemoteAddress();
    $conn->close();
});

Note that the react/socket component already has a similar class (https://github.com/reactphp/socket/blob/master/src/Connection.php) which represents the server-side end of a connection.

Activity

  1. clue commented on Apr 20, 2016

    @clue
    ContributorAuthor
  2. added this to the v0.6.0 milestone on Nov 20, 2016
  3. samuel-allan commented on Nov 27, 2016

    @samuel-allan

    Mind if I try fixing this and submitting a PR?

  4. clue commented on Nov 27, 2016

    @clue
    ContributorAuthor

    I've started working on this a few months ago, finished the tests and code but didn't get to properly document this and the potential BC break. The other PRs were also certainly more pressuring back then, but this is now higher on my todo list again.

    Other than that, not at all, go ahead 👍

  5. samuel-allan commented on Feb 17, 2017

    @samuel-allan

    Nice! I will probably now start work on the other remote addr issue (clue-legacy/php-socks-server#5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions