GithubHelp home page GithubHelp logo

Support Sub-Protocols about pawl HOT 6 CLOSED

ratchetphp avatar ratchetphp commented on July 25, 2024
Support Sub-Protocols

from pawl.

Comments (6)

yieldinov avatar yieldinov commented on July 25, 2024

You're awesome! Thanks for your work!
This feature will be very nice when you release it as soon as possible.

Did I understood you right? It will look like:

<?php
...
$connector('ws://127.0.0.1:8080', $subprotocol)->then(function(Ratchet\Client\WebSocket $conn) {
        $conn->on('message', function($msg) {
            echo "Received: {$msg}\n";
        });
...

And will be sent headers:

"Sec-WebSocket-Protocol: " . $subprotocol . "\r\n";

from pawl.

cboden avatar cboden commented on July 25, 2024

Close, the sub-protocol parameter is an array:

$futureConn = $connector('ws://127.0.0.1:8080', ['sub-protocol-1', 'subprotocol-2']);

from pawl.

adeshpandey avatar adeshpandey commented on July 25, 2024

is there a way to disable subprotocol check ?

from pawl.

cboden avatar cboden commented on July 25, 2024

Not on the client side. The server accepts any sub-protocol requests from the client and decides how to handle from there.

from pawl.

dacoders77 avatar dacoders77 commented on July 25, 2024

What about HYBI protocol support?
https://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-14
I am trying to connect to this C# server

from pawl.

cboden avatar cboden commented on July 25, 2024

HyBi is the code-name for beta version of the WebSocket protocol (now RFC6455); it is not a sub-protocol. Ratchet no longer supports HyBi as it graduated to the RFC with the HTTP version header increment.

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.