permessage-deflate incompatible with WKWebView Websocket client and connection getting closed - 1002 status
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- networking
Research direction
Start by running the attached SampleWebSocketServer.zip and SampleWebSocketApp.zip with iPadOS 15 Beta behavior, focusing on permessage-deflate and messages sent in multiple frames. Compare the failing fragmented-message exchange with the working single-frame and IgnoreExtensions cases. Done means identifying the protocol-handling incompatibility and confirming corrected behavior with fragmented compressed messages.
Written by the indexing model from the issue text.
Description
We are having Native swift application which used WKWebView to render app content in JavaScript and HTML. We are using websocket client in JavaScript to connect with WebSocket-Sharp server.
Until the current release iPadOS 14.x versions, WKWebView JS websocket client is sending below extension.
Sec-WebSocket-Extensions: x-webkit-deflate-frame
And the WebSocket-Sharp is not sending back any header and no compression technique is followed between the server and client when any message is being sent.
With the recent release of iPadOS 15 Beta, while establishing handshake WKWebView JS websocket client is sending below extension.
Sec-WebSocket-Extensions: permessage-deflate
And the WebSocket-Sharp server responding with below header in response.
Sec-WebSocket-Extensions: permessage-deflate; client_no_context_takeover; server_no_context_takeover
And when any message is being sent from server (websocket-sharp) to client (iPad OS 15 Beta), we are facing below error at client end and client socket instance is getting closed with 1002 - protocol error.
nw_ws_parse_input_block_invoke [C4:4] inflate returned data error
There is another catch here that only messages which are sent in multiple frames are getting thrown this exception, and if we modify FragmentLength in c# to handle large messages and sending in single frame, it is working fine.
And also I tried IgnoreExtensions, in that case also working fine, but wanted to know why this is failing with permessage-deflate extension ?
Attached the sample native swift application and websocket-sharp server code.
SampleWebSocketServer.zip
SampleWebSocketApp.zip
Can anyone help me why this is getting failed with messages that are being sent in multiple frames, when permessage-deflate extension is sent from client ?
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sta/websocket-sharp
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sta/websocket-sharp#201 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
sta/websocket-sharp#762 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
sta/websocket-sharp#761 ·
-
Bad handling of sending stream makes lib not RFC compatible and KeepClean useless in some cases. Open
Difficulty 4/5 3-5 days Newbie friendliness 42/100
sta/websocket-sharp#760 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sta/websocket-sharp#759 ·
All issues in sta/websocket-sharp
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
azurenoops/spin_agent#975 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·