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).

!7

lib 1014685 // websocket

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;

p-experiment-tt {
  WebSocketClient client = new WebSocketClient(new URI("ws://butter.botcompany.de:8080/1014677")) {
    public void onMessage(S s) {
      if (eq(s, "clear")) clearConsole();
      else print(shorten(400, bytesToHex(toUtf8(s))));
      //else print_noNewLine("<" + dropFirst(s) + ">");
    }

    public void onOpen(ServerHandshake handshake) {}
    public void onClose(int code, S reason, bool remote) {
      print("closed connection");
    }
    public void onError(Exception e) { printStackTrace(e); }
  };
  
  assertTrue("connect", client.connectBlocking());
}

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: 430 / 531
Version history: 7 change(s)
Referenced in: #1015081 - Eleu Live Log [Swing], dropping the weird WebSocket \0 bytes [OK]