Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

24
LINES

< > BotCompany Repo | #1015080 // Reproduce Web Socket Null Byte Bug

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 3988K of libraries. Click here for Pure Java version (7229L/49K/176K).

1  
!7
2  
3  
lib 1014685 // websocket
4  
5  
import org.java_websocket.client.WebSocketClient;
6  
import org.java_websocket.handshake.ServerHandshake;
7  
8  
p-experiment-tt {
9  
  WebSocketClient client = new WebSocketClient(new URI("ws://butter.botcompany.de:8080/1014677")) {
10  
    public void onMessage(S s) {
11  
      if (eq(s, "clear")) clearConsole();
12  
      else print(shorten(400, bytesToHex(toUtf8(s))));
13  
      //else print_noNewLine("<" + dropFirst(s) + ">");
14  
    }
15  
16  
    public void onOpen(ServerHandshake handshake) {}
17  
    public void onClose(int code, S reason, bool remote) {
18  
      print("closed connection");
19  
    }
20  
    public void onError(Exception e) { printStackTrace(e); }
21  
  };
22  
  
23  
  assertTrue("connect", client.connectBlocking());
24  
}

Author comment

Began life as a copy of #1014686

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1015080
Snippet name: Reproduce Web Socket Null Byte Bug
Eternal ID of this version: #1015080/8
Text MD5: 01c6583e7bdc15a3416a0ff4396cb233
Transpilation MD5: 2798ff94db6d7c1ad4313972a6b1f33e
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-07 23:50:03
Source code size: 741 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 366 / 444
Version history: 7 change(s)
Referenced in: [show references]