uWebSockets.js icon indicating copy to clipboard operation
uWebSockets.js copied to clipboard

Safari permessage-deflate

Open anton-piliugin opened this issue 7 years ago • 8 comments

Hello. I'm having an issue with Safari both on mobile and desktop. Stackoverflow says that the problem is empty header sent by a server. I run SSLApp, with Let's Encrypt certificate

UPDATE: found a bug - compression set to 1 causes this issue, when i disable compression everything works beautifully

anton-piliugin avatar Feb 27 '19 09:02 anton-piliugin

I think this is the Safari not supporting permessage-deflate bug. I think the solution was to call it something different. The old v0.14 solved it one time ago.

x-compress or something non-standard Apple-ishy

ghost avatar Feb 27 '19 16:02 ghost

i have same bug on Mac Safari, there is the error: WebSocket connection to 'ws://server.com/' failed: Invalid UTF-8 sequence in header value, safari need x-webkit-deflate-frame extension, need fix for it =)

Vladislavik avatar Mar 01 '19 14:03 Vladislavik

Looks like Safari doesn't support permessage-deflate but supports x-webkit-deflate-frame. Is it possible to not enable compression if there is no Sec-WebSocket-Extension: permessage-deflate in HTTP request headers?

mrlika avatar Mar 01 '19 14:03 mrlika

It should be fixed now, let's wait for things to build and then npm install uNetworking/uWebSockets.js#binaries and check if it works

ghost avatar Mar 01 '19 14:03 ghost

@mrlika The bug was that it sends an empty sec-websocket-extension header value because it failed to negotiate anything. It should not send anything if nothing was negotiated.

Adding support for x-webkit-deflate-frame as an alias to permessage-deflate could be a simple fix, but I rather see Apple fix their obscure browser :wink:

ghost avatar Mar 01 '19 14:03 ghost

npm install uNetworking/uWebSockets.js#v15.3.0

See if it works

ghost avatar Mar 01 '19 14:03 ghost

yes, it is work, but work without deflate-frame now?

Vladislavik avatar Mar 01 '19 15:03 Vladislavik

x-webkit-deflate-frame should be supported in latest version

ghost avatar Jan 12 '21 23:01 ghost