Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bug fixed: array_intersect([ "protocol1" ], [ "protocol1,subprotocol2" ]) #39

Closed
wants to merge 1 commit into from

Conversation

clwu88
Copy link

@clwu88 clwu88 commented Feb 21, 2020

my nodejs websocket server use these code:

const WebSocket = require('ws');

const wss = new WebSocket.Server({
                                    server : 'localhost',
                                    port   : 8888
                                 }); 

wss.on('connection', function connection(ws) {
    ws.on('message', function incoming(message) {
        ws.send(message); // echo
    }); 
})

my php websocket client use these code:

$reactConnector = new \React\Socket\Connector($loop, [ 'timeout' => 10 ]);
$connector = new \Ratchet\Client\Connector($loop, $reactConnector);
 
$connector('ws://127.0.0.1:8888', ['protocol1',  'subprotocol2'], ['Origin' => 'http://localhost'])

but I got a bug on my php code ,
php client code

// array_intersect([ "protocol1" ], [ "protocol1,subprotocol2" ])  has a bug
array_intersect($responseHeader, $requestHeader);

// array_intersect([ "protocol1" ], [ "protocol1", "subprotocol2" ]) this is what we want

so I make this pull request

@mbonneau
Copy link
Member

@clwu88 Thanks for the catch! This is resolved in #40 along with another edge case.

@mbonneau mbonneau closed this May 14, 2020
@cboden cboden added this to the 0.3 milestone May 15, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants