-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Websockets 1002 Unknown opcode: 7 with Jetty on Mac, but not Linux or Win10 #12390
Comments
Also, I tested downgrading to Jetty 10.0.22 and 10.0.20, but the above test case fails there too. |
@afarber sorry, but Jetty 10/11 are at end of community support: Please upgrade to Jetty 12 and report back if you still have the problem. |
Yes, this bug seems to be in Jetty 12 too:
To reproduce:
And then just navigate to the URLs:
I have tried both Edge and Safari browsers on macOS 15 |
@afarber can you report the HTTP Upgrade Request and Response headers from your developer tools on safari and edge? |
Noting the websocket bugs listed for webkit (used by both edge and safari on macos)
Also, what is the exact versions listed for your safari and edge browsers? |
Edge request headers:
Edge response headers:
|
Safari request headers:
Safari response headers:
|
Yup, you have websocket compression via the If you use something like Chrome on that same Mac, does it also fail? (it has a different underlying web technology codebase). Oddly, the reported browser, in both cases is "Macintosh; Intel Mac OS X 10_15_7", which isn't a M1 mac. |
Firefox request headers:
Firefox response headers:
|
Sorry, I cannot install Chrome, because I do not want them to track my Android dev account or ban Google/Android phone accounts of me and my relatives. They already banned my AdSense account for nothing maybe 15 years ago and the experience was bad. |
I only have a Macbook Pro from 2012, can't upgrade it to Seqouia. Seeing as websocket compression is just continually hosed on Safari and webkit, it's probably time to implement a User-Agent based compression logic at the low level websocket negotiation code. We are not the only group struggling with webkit issues with websocket compression.
The three User-Agents look like ...
I think we should look for either @lachlan-roberts what do you think about having a configurable for something like "websocket.compression.webkit.enabled=false" as a default. |
Ya know, maybe a Similar to what we used to have back in Jetty 9, with the MsieSslRule. It could be enabled rather quickly from a jetty-home module too. |
I cannot reproduce the issue at all on my Mac. I can join the websocket chatroom and send messages with no errors on Safari, Firefox and Edge. Here are my results for comparison. System Specs
Firefox 131.0.3 (64-bit)Request Headers
Response Headers
Edge Version 130.0.2849.46 (Official build) (x86_64)Request Headers
Response Headers
Safari Version 17.6 (17618.3.11.11.7, 17618)Request Headers
Response Headers
|
@joakime I'm not sure we should just disable compression for all Mac OS. Unless we find know why its actually failing and that is not a bug in Jetty. My User-Agent headers were exactly the same and there was no failure. |
@afarber as a workaround you could just disable websocket compression in your Try clearing out the extensions on the |
@lachlan-roberts I have tried your suggestion to filter out "permessage-deflate" and it is not helping in my test project: Edge request headers:
Edge response headers (without "permessage-deflate"):
Jetty logs:
|
If you look around other issue trackers (outside of Jetty), you will quickly see that the support for websocket compression on Mac OS has been more often broken across its history than it is working. |
@afarber can you please collect full Jetty debug logs for when the issue occurs and post it here. |
@afarber you can run the chat demo on
to have it output in DEBUG mode. Or you can do the following, which might be easier.
Run the tests in your browser, and then |
Here you go @joakime , do you want wireshark logs captured too? |
Thanks! |
The output of The output of |
It looks like Jetty is receiving the upgrade request twice in a row on the same connection, and trying to parse it as WebSocket but it is really just HTTP/1.1 bytes. There seems to be some intermediary on port 10011 which is first receiving the weboscket upgrade request and then forwarding it on to jetty at port 8080. And this is what sends the double HTTP GET request to Jetty which is incorrect as it will be interpreted as websocket data. |
I think privado networks llc is a VPN, so this is potentially causing the issue. |
Either way it doesn't seem to be a bug in Jetty. |
Yes, Privado VPN client, is not active though... So maybe it is Microsoft Teams, Edge or Microsoft AutoUpdater... Sure it is not a Jetty bug and sorry for reporting it as one initially. Wouldn't it be nice though to have an optional Jetty setting to ignore duplicated HTTP upgrade requests? |
Also, since you are using Sequoia - https://www.techradar.com/pro/vpn/apple-fixes-bug-breaking-security-software-but-this-mac-vpn-remains-vulnerable |
Unfortunately its not feasible. At that point the connection is already upgraded to WebSocket so we don't want to run an HttpParser just in case there is illegal HTTP bytes there.
From the output you posted looks like they are just clients connecting to port 10011 not listening on it. |
It is probably "screen time". I tried disabling it, but the issue persisted. |
No fix possible. reclosing as not-planned. |
I have reported the bug at https://feedbackassistant.apple.com/feedback/15715103 |
Jetty version(s)
12.0.14
Java version/vendor
(use: java -version)
javac 23
OS type/version
macOS Sequoia
How to reproduce?
Please run the ./test-mac.sh script in the attached zip archive and then open the URL http://127.0.0.1:8080/en/ in Edge or Firefox browser on macOS and look at the browser console:
jetty-mac-opcode-7.zip
The test Javascript code is in the file jetty-mac-opcode-7/my-servlet/src/main/resources/index.html
Thank you
The text was updated successfully, but these errors were encountered: