laravel-websockets icon indicating copy to clipboard operation
laravel-websockets copied to clipboard

server crash

Open amir-khoshbakht opened this issue 2 years ago • 5 comments

I have found a bug in ratchet websocket server library that you are extending one of its php files. sending a post request with integer keys to the websocket server will crash it.

i think the best way to deal with it is to override onMessage function with its parent from ratchet library but change OverflowException to Throwable https://github.com/beyondcode/laravel-websockets/blob/605a7fa71ddabfffe381b079acc21403c7547ea2/src/Server/HttpServer.php#L8

actually this bug is from : 1- https://github.com/guzzle/psr7/blob/5c693242bede743c23402bc5b9de62da04a882d7/src/Message.php#L178 If a header with a numeric key is used, this code will fail. Which I reported here : https://github.com/guzzle/psr7/issues/497#issuecomment-1077576249 2- https://github.com/ratchetphp/Ratchet/blob/5012dc954541b40c5599d286fd40653f5716a38f/src/Ratchet/Http/HttpServer.php#L45 it seems the package is abandoned and there is no sign of any activity after 48 hours: https://github.com/ratchetphp/Ratchet/issues/955

amir-khoshbakht avatar Mar 26 '22 09:03 amir-khoshbakht

Also this package is abandoned

PaolaRuby avatar Mar 28 '22 13:03 PaolaRuby

Err no it's not

mpociot avatar Mar 28 '22 13:03 mpociot

My bad ❤️, please review PRs

PaolaRuby avatar Mar 28 '22 13:03 PaolaRuby

What PRs?

image

GrahamCampbell avatar Apr 03 '22 15:04 GrahamCampbell

@GrahamCampbell from others, not from me

PaolaRuby avatar Apr 03 '22 17:04 PaolaRuby