Closed disarticulate closed 6 years ago
This is the intended behavior:
Messages are delivered to subscribers in text websocket frames, except if a message's content-type is "application/octet-stream" -- then it is delivered in a binary frame.
The intention is not to process blobs?
On Sat, Mar 31, 2018, 7:53 PM slact notifications@github.com wrote:
This is the intended behavior:
Messages are delivered to subscribers in text websocket frames, except if a message's content-type is "application/octet-stream" -- then it is delivered in a binary frame.
see https://nchan.io/#websocket
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/slact/nchan.js/pull/15#issuecomment-377734385, or mute the thread https://github.com/notifications/unsubscribe-auth/AQp7PeuSiT8BbpfgUtlFnrkZAIr-pt4Cks5tkCUlgaJpZM4TCf5G .
err, the content-type behavior is as intended.
Your Blob fix was the right approach, but it needed a little more massaging. Thanks for the PR, i'll release this version on npm in a few days.
I guess my point was that you can't send binary frames via the websocket. I was aware that you can send binary data to the POST channel.
Is there a technical reason not to let websockets send binary messages?
You can send binary frames via websocket by adding add_header "Content-Type" "application/octet-stream";
to your nginx publisher location. There is no way to conditionally send binary blobs over websocket for a given URL.
application/octet-stream are transmitted as binary blobs
also note:
which makes it pretty useless as content-type isn't transferred.