-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with handshake regex #16
Comments
Fixed by using our header parser in I'd like to rework this library in the coming months, hopefully splitting some of the common parts shared by |
@trowski Thanks for providing that reference however it's still an issue as I connect using: $handshake = new Websocket\Handshake('someSuperCoolUrl');
$connection = yield Websocket\connect($handshake); Are you suggesting I fork the library implement the header parser and submit a PR? Happy to do so if you are happy include the ampphp/http dependency in websocket-client .... |
@trowski Scrap that, I can see the fixes in 0.2.3. I misunderstood your explanation above. Cheers :) |
@dotstormz Sorry that I was confusing. Hopefully it's working for you. I decided to start working on splitting the common parts of this library up into |
I'm having an issue getting a legitimate Websocket handshake to be recognised. Initially I thought it was the AWS ALB implementation and how is handled headers however debugging suggests its the library. I have looked at the regex in Handshake.php to try and work out the problem. After running the regex through a regex tool I noticed there were some errors in the regex.
The HTTP1.1 Response looks like this:
The regex I am referring to is here: https://github.com/amphp/websocket-client/blob/master/lib/Handshake.php#L84
I was getting the error
'Missing "Upgrade: websocket" header.'
. I changed it the following and it now works as expected. Can someone please let me know why the additional slashes were in the original regex as they are not valid? Happy to change it back if required but it would be awesome if anyone can identify any problems with my response.The text was updated successfully, but these errors were encountered: