Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Websockets 1002 Unknown opcode: 7 with Jetty 10.0.24 on Mac, but not Linux, Win10

Good morning,

I am using Jetty on MacOS, Win10, Rocky Linux 8 like this:

java -jar jetty-home-10.0.24/start.jar jetty.home=jetty-home-10.0.24 jetty.base=jetty.base --add-module=http,webapp,deploy,resources,websocket
java -Djdbc.drivers=org.postgresql.Driver -jar jetty-home-10.0.24/start.jar jetty.home=jetty-home-10.0.24 jetty.base=jetty.base

and in my custom org.eclipse.jetty.websocket.serverJettyWebSocketServlet there is the code:

    @Override
    public void configure(JettyWebSocketServletFactory factory) {
        factory.setIdleTimeout(Duration.ofSeconds(300));
        factory.setMaxBinaryMessageSize(0);
        factory.setMaxTextMessageSize(64 * 1024);
        factory.setCreator(new WordsCreator(this));
    }

I have not visited that project for 6 months except updating Jetty minor version and now suddenly it has stopped working and I have problems to understand why.

In the Edge web browser (I have tried Firefox too) on Mac I am getting _javascript_ WebSocket CloseEvent code 1002, reason "Unknown opcode 7".

And in my servlet log I see:

onWebSocketConnect: address=127.0.0.1:54403 session=WebSocketSession[SERVER,to=PT5M,WSCoreSession@77e854{SERVER,WebSocketSessionState@7dc721b5{CONNECTED,i=NO-OP,o=NO-OP,c=null},[ws://127.0.0.1:8080/en/,null,false.[permessage-deflate]],af=true,i/o=4096/4096,fs=65536}->JettyWebSocketFrameHandler@53da9542[de.afarber.WordsListener],JettyWebSocketFrameHandler@53da9542[de.afarber.WordsListener]]

I have tried capturing the packets with Wireshark on my Macbook Air too:

   35   1.511485    127.0.0.1 → 127.0.0.1    TCP 68 60903 → 8080 [SYN] Seq=0 Win=65535 Len=0 MSS=16344 WS=64 TSval=1247263601 TSecr=0 SACK_PERM
   36   1.511532    127.0.0.1 → 127.0.0.1    TCP 68 8080 → 60903 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=16344 WS=64 TSval=983459316 TSecr=1247263601 SACK_PERM
   37   1.511540    127.0.0.1 → 127.0.0.1    TCP 56 60903 → 8080 [ACK] Seq=1 Ack=1 Win=408256 Len=0 TSval=1247263602 TSecr=983459316
   38   1.511547    127.0.0.1 → 127.0.0.1    TCP 56 [TCP Window Update] 8080 → 60903 [ACK] Seq=1 Ack=1 Win=408256 Len=0 TSval=983459316 TSecr=1247263602
   39   1.512509    127.0.0.1 → 127.0.0.1    HTTP 618 GET /de/ HTTP/1.1
   40   1.512542    127.0.0.1 → 127.0.0.1    TCP 56 8080 → 60903 [ACK] Seq=1 Ack=563 Win=407680 Len=0 TSval=983459317 TSecr=1247263602
   41   1.515616    127.0.0.1 → 127.0.0.1    HTTP 255 HTTP/1.1 101 Switching Protocols
   42   1.515647    127.0.0.1 → 127.0.0.1    TCP 56 60903 → 8080 [ACK] Seq=563 Ack=200 Win=408064 Len=0 TSval=1247263606 TSecr=983459320
   43   1.515865    127.0.0.1 → 127.0.0.1    HTTP 255 HTTP/1.1 101 Switching Protocols
   44   1.515880    127.0.0.1 → 127.0.0.1    TCP 56 60902 → 10011 [ACK] Seq=699 Ack=200 Win=408064 Len=0 TSval=3851650692 TSecr=1585164609
   45   1.517191    127.0.0.1 → 127.0.0.1    WebSocket 288 WebSocket Text [FIN] [MASKED]
   46   1.517251    127.0.0.1 → 127.0.0.1    TCP 56 10011 → 60902 [ACK] Seq=200 Ack=931 Win=407360 Len=0 TSval=1585164610 TSecr=3851650693
   47   1.517462    127.0.0.1 → 127.0.0.1    WebSocket 618 WebSocket Unknown Opcode[FRAGMENT]  
   48   1.517479    127.0.0.1 → 127.0.0.1    TCP 56 8080 → 60903 [ACK] Seq=200 Ack=1125 Win=407168 Len=0 TSval=983459321 TSecr=1247263607
   49   1.517488    127.0.0.1 → 127.0.0.1    WebSocket 288 WebSocket Unknown Opcode[FRAGMENT]  WebSocket Pong [FIN]
   50   1.517491    127.0.0.1 → 127.0.0.1    TCP 56 8080 → 60903 [ACK] Seq=200 Ack=1357 Win=406912 Len=0 TSval=983459321 TSecr=1247263607
   51   1.517984    127.0.0.1 → 127.0.0.1    WebSocket 77 WebSocket Connection Close [FIN]
   52   1.518010    127.0.0.1 → 127.0.0.1    TCP 56 60903 → 8080 [ACK] Seq=1357 Ack=221 Win=408064 Len=0 TSval=1247263607 TSecr=983459321
   53   1.518041    127.0.0.1 → 127.0.0.1    TCP 56 8080 → 60903 [FIN, ACK] Seq=221 Ack=1357 Win=406912 Len=0 TSval=983459321 TSecr=1247263607
   54   1.518057    127.0.0.1 → 127.0.0.1    TCP 56 60903 → 8080 [ACK] Seq=1357 Ack=222 Win=408064 Len=0 TSval=1247263607 TSecr=983459321
   55   1.518154    127.0.0.1 → 127.0.0.1    WebSocket 77 WebSocket Connection Close [FIN]
   56   1.518168    127.0.0.1 → 127.0.0.1    TCP 56 60902 → 10011 [ACK] Seq=931 Ack=221 Win=408064 Len=0 TSval=3851650693 TSecr=1585164610
   57   1.518229    127.0.0.1 → 127.0.0.1    WebSocket 81 WebSocket Connection Close [FIN] [MASKED]
   58   1.518250    127.0.0.1 → 127.0.0.1    TCP 56 10011 → 60902 [ACK] Seq=221 Ack=956 Win=407296 Len=0 TSval=1585164611 TSecr=3851650694
   59   1.519442    127.0.0.1 → 127.0.0.1    TCP 44 10011 → 60902 [RST, ACK] Seq=221 Ack=956 Win=407296 Len=0
   60   1.519533    127.0.0.1 → 127.0.0.1    TCP 56 60903 → 8080 [FIN, ACK] Seq=1357 Ack=222 Win=408064 Len=0 TSval=1247263610 TSecr=983459321
   61   1.519564    127.0.0.1 → 127.0.0.1    TCP 56 8080 → 60903 [ACK] Seq=222 Ack=1358 Win=406912 Len=0 TSval=983459324 TSecr=1247263610
   62   1.753595    127.0.0.1 → 127.0.0.1    TCP 56 8080 → 60779 [FIN, ACK] Seq=1 Ack=1 Win=6373 Len=0 TSval=1919100862 TSecr=2392561704
   63   1.753657    127.0.0.1 → 127.0.0.1    TCP 56 60779 → 8080 [ACK] Seq=1 Ack=2 Win=6370 Len=0 TSval=2392591713 TSecr=1919100862
   64   1.753841    127.0.0.1 → 127.0.0.1    TCP 56 8080 → 60751 [FIN, ACK] Seq=1 Ack=1 Win=6330 Len=0 TSval=2248002552 TSecr=1599215285
   65   1.753874    127.0.0.1 → 127.0.0.1    TCP 56 60751 → 8080 [ACK] Seq=1 Ack=2 Win=7593 Len=0 TSval=1599245294 TSecr=2248002552
   66   1.753987    127.0.0.1 → 127.0.0.1    TCP 56 10011 → 60778 [FIN, ACK] Seq=1 Ack=1 Win=6370 Len=0 TSval=1377140570 TSecr=2963500849
   67   1.753996    127.0.0.1 → 127.0.0.1    TCP 56 8080 → 60768 [FIN, ACK] Seq=1 Ack=1 Win=6351 Len=0 TSval=3195669984 TSecr=2566348921
   68   1.754019    127.0.0.1 → 127.0.0.1    TCP 56 60778 → 10011 [ACK] Seq=1 Ack=2 Win=6370 Len=0 TSval=2963530858 TSecr=1377140570
   69   1.754025    127.0.0.1 → 127.0.0.1    TCP 56 60768 → 8080 [ACK] Seq=1 Ack=2 Win=6365 Len=0 TSval=2566378930 TSecr=3195669984
   70   1.754176    127.0.0.1 → 127.0.0.1    TCP 56 60779 → 8080 [FIN, ACK] Seq=1 Ack=2 Win=6370 Len=0 TSval=2392591713 TSecr=1919100862
 
I wonder, what is happening there, why is it working on Linux, Win10, but not anymore on MacOS Sonoma.

Is it maybe that the Jetty is asking the Edeg web browser if it want to use some kind of Websockets protocol extension?

After I fix this issue, I hope to update my custom servlet to Jetty 12, to stay on the current version...

Best regards
Alex


Back to the top