title: Java Web Socket close (getCloseCode : TOO BIG)
body: <p>I'm trying to build a chat application with Java server and JS client. It's ok but </p>
  
  <p>when I try to send an <strong>image from the client with base64 format</strong>, the server closed with the reason <strong>TOO BIG</strong>. </p>
  
  <p>So how can I increase the transport limit? Or if there's another way to send an image to the server, </p>
  
  <p>please tell me. Thanks. The code below:</p>
  
  <p>The server:</p>
  
  <pre class="lang-java prettyprint-override"><code>@ServerEndpoint(value = "/chat/{username}", decoders = MessageDecoder.class, encoders = MessageEncoder.class)
  public class ChatEndpoint {
      private Session session;
      private static final Set&lt;ChatEndpoint&gt; chatEndpoints = new CopyOnWriteArraySet&lt;&gt;();
      private static HashMap&lt;String, String&gt; users = new HashMap&lt;&gt;();
      static boolean checkAll = true;
      static String userAll;
      @OnOpen
      public void onOpen(Session session, @PathParam("username") String username) throws IOException, EncodeException {
      ...
  }
      @OnMessage
      public void onMessage(Session session, Message message) throws IOException, EncodeException, SQLException, ClassNotFoundException {
      broadcast(message); 
  }
      ...
      private static void broadcast(Message message) throws IOException, EncodeException {
          chatEndpoints.forEach(endpoint -&gt; {
              synchronized (endpoint) {
                  try {
                      endpoint.session.getBasicRemote()
                          .sendObject(message);
                      //System.out.println("end point "+endpoint.session.getUserProperties().get("username"));                    
                  } catch (IOException | EncodeException e) {
                      e.printStackTrace();
                  }
              }
          });
      }
  </code></pre>
  
  <p>And the client:</p>
  
  <pre><code>ws = new WebSocket("ws://" + document.location.host + "/Project1.3/chat/" + username);
  ws.onMessage = ...
  ...
  function send(to) {
      var content = document.getElementById("message").value;
      $('#message').val('');
      var json = JSON.stringify({
          "from":username,
          "to":to,
          "content":content,
          "type":"text"
      });
      ws.send(json);
  }
  </code></pre>