Git Product home page Git Product logo

Comments (6)

mougrim avatar mougrim commented on June 30, 2024

Possibility to use \React\SocketClient\TcpConnector instead of \React\SocketClient\DnsConnector would be great to.

from pawl.

cboden avatar cboden commented on June 30, 2024

The connect function is meant to simplify 90% of use cases by having a minimal API. The Connector class allows more customization, including a custom DNS Resolver, which is what you should use if that's required.

I don't quite follow your second comment about the Connectors?

from pawl.

mougrim avatar mougrim commented on June 30, 2024

@cboden after half a year, I'm not sure, what I did mean.
But I think, it's about src/Connector.php:

$this->_connector       = new SocketConnector($loop, $resolver);

SocketConnector is deprecated and \React\SocketClient\DnsConnector's wrapper.
So, I think it would better have possibility to provide connector. If it isn't passed, use \React\SocketClient\DnsConnector.

So, ok, I can create my own function create, but I can't provide custom connector to \Ratchet\Client\Connector::__construct().
Instead of parameter Resolver $resolver = null we can use connector parameter.

from pawl.

mougrim avatar mougrim commented on June 30, 2024

The connect function is meant to simplify 90% of use cases by having a minimal API. The Connector class allows more customization, including a custom DNS Resolver, which is what you should use if that's required.

Also it would great to add doc to function connect about it.

from pawl.

mbonneau avatar mbonneau commented on June 30, 2024

+1 for adding a connector argument to the constructor instead of the resolver.

from pawl.

cboden avatar cboden commented on June 30, 2024

With the release of v0.3 you can now customize DNS information on the Connector class via React's Connector class. See the example at the bottom of the README for an example.

from pawl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.