Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Websocket handling issues

Hello Joakim,

I did take a Wireshark to both the Java-Websocket server and the Jetty webserver (packet captures attached), but to be honest, it only got me even more confused, since I'm now seeing encoding differences between the two, and I'm not really sure where the ISO-8859-1 charset is coming from nor why it would cause a length mismatch...

Best Regards,

Zalan Meggyesi
Chief Support Engineer
Skawa Innovation Kft.

Mobile: +36205146666


On Fri, Mar 8, 2019 at 10:23 PM Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
You can use a tool like Wireshark and see what's being sent back/forth with a breakdown of the WebSocket frames (headers+payload)
You should be able to see where that bad Frame with RSV1 set to true is coming from.

From what I can tell, the project org.java_websocket is throwing that exception because it thinks it sees a frame with RSV1 set to true.
That should only be true for the combination of using permessage-deflate extension and the frame being a non-continuation data frame (TEXT/BINARY).

Joakim Erdfelt / joakim@xxxxxxxxxxx


On Fri, Mar 8, 2019 at 11:52 AM Meggyesi, Zalán <zmeggyesi@xxxxxxxx> wrote:
Hello Joakim,

I ran a build of Jetty 10.0.0 based on the latest source, but I'm still getting the exception: org.java_websocket.exceptions.InvalidFrameException: bad rsv RSV1: true RSV2: false RSV3: false
I saw your PR merged, so I'm probably doing something wrong, but I have no idea what...

Best,

Zalan Meggyesi
Chief Support Engineer
Skawa Innovation Kft.

Mobile: +36205146666


On Fri, Mar 1, 2019 at 11:08 PM Meggyesi, Zalán <zmeggyesi@xxxxxxxx> wrote:
Hello again,

I did try sending Sec-WebSocket-Extensions:[deflate-frame] this time, but it still resulted in an exception (org.java_websocket.exceptions.InvalidFrameException: bad rsv RSV1: true RSV2: false RSV3: false).

Just to let you know.

Best,
Zalan

On Fri, Mar 1, 2019 at 10:36 PM Meggyesi, Zalán <zmeggyesi@xxxxxxxx> wrote:
Hello Joakim,

Thanks for your quick reply, this is very helpful!
I added a line to log the request headers:
22:18:22.772 [qtp33233312-29] INFO  h.s.s.g.filters.LoggerFilter - Headers: 
Sec-WebSocket-Key:[SquKmRXFd5Bt4jUcPD0mkw==]
Connection:[Upgrade]
Sec-WebSocket-Version:[13]
Host:[localhost:8000]
Upgrade:[websocket]
while the response headers have
Connection: Upgrade; Upgrade
Date: Fri, 01 Mar 2019 21:35:24 GMT
Sec-WebSocket-Accept: LlhSOQ+9EI8rCJ2z9vb5wEhG2bM=
Server: Jetty(9.4.12.v20180830)
Upgrade: WebSocket
Let me know if this is helpful to you!

Best Regards,
Zalan

On Fri, Mar 1, 2019 at 10:16 PM Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
Actually, I am making an assumption that https://github.com/TooTallNate/Java-WebSocket/ only supports permessage-deflate.
It could be that it also supports deflate-frame (an older deprecated extension that Jetty also supports).

Can you please double check what the HTTP Upgrade Request headers and HTTP Upgrade Response headers are?
That will tell us exactly what extensions were negotiated.

Joakim Erdfelt / joakim@xxxxxxxxxxx


On Fri, Mar 1, 2019 at 4:11 PM Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
Disable permessage-deflate and don't negotiate it between your client / server.

You've stumbled into a variant of issue https://github.com/eclipse/jetty.project/issues/3159

Joakim Erdfelt / joakim@xxxxxxxxxxx


On Fri, Mar 1, 2019 at 2:29 PM Meggyesi, Zalán <zmeggyesi@xxxxxxxx> wrote:
Hi,

I've floated this problem a while ago, but I only just got around to actually getting some data on it.

It seems like websocket handling ... well, for lack of a better word, "broke" after v9.4.12.v20180830.
I'm using the Ninja Framework, which bundles this version of Jetty as its internal webserver, and if I launch a skeleton WS server using the bundled Jetty instance, connections go through just fine. On the other hand, if I use the latest Jetty plugin from Maven Central, and launch the same WS server, I get an error when I try to send a message, specifically, org.java_websocket.exceptions.InvalidFrameException: bad rsv RSV1: true RSV2: false RSV3: false. I'm using this project as my WS client.

Now, my go-to reaction would be to simply downgrade my standalone Jetty installation to 9.4.12, but unfortunately because my real application runs under Java 11, I cannot do that (due to an outdated ASM in the 9.4.12 version).

Can anyone give me some pointers as where this might be going wrong?

Best,
Zalan
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users

Attachment: unsuccessful connection.pcapng
Description: Binary data

Attachment: successful connection.pcapng
Description: Binary data


Back to the top