Skip to content

Different api by client transport providers #165

Closed
@RafaelKa

Description

@RafaelKa

PawlTransportProvider

    /**
     * Constructor
     *
     * @param string $URL
     */
    function __construct($URL = "ws://127.0.0.1:8080/")
    {
        $this->URL     = $URL;
    }

and RawSocketClientTransportProvider

    /**
     * Constructor
     *
     * @param string $address
     * @param int $port
     */
    function __construct($address = "127.0.0.1", $port = 8181)
    {
        $this->address   = $address;
        $this->port      = $port;
        $this->transport = null;
    }

have different constructors.

I would like to provide a PR for united API but i'm not sure which way is preferred by community.

Please note, that react/socket-client provides tls and UDS connections
as well ratchet/pawl provides secure web socket connection

So i think url way will be more robust:
for Pawl

'ws://domain_name_or_ip:port'
'wss://domain_name_or_ip:port'
'unix:///path_to_uds.sock' 

Not sure but Pawl seems to support currently unix:// as well, because it uses Connector::create() method from react/socket-client

for RawSocket

'tcp://domain_name_or_ip:port'
'tls://domain_name_or_ip:port'
'unix:///path_to_uds.sock'

Also i think that the RawSocketClientTransportProvider can be revised to give a way for similar api with Pawl.

PS: I provided PR for react/socket UDS support and psychoticmeow did similar for UDS but with BC break so if it is merged we can use UDS for router as well.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions