title: How to add headers in Java Websocket client
body: <p>I am connecting to a websocket server in Java using <code>javax.websocket</code> classes.</p>
  
  <pre><code>import javax.websocket.DeploymentException;
  import javax.websocket.Session;
  import javax.websocket.WebSocketContainer;
  import java.io.IOException;
  import java.net.URI;
  
  public class WSClient {
      private WebSocketContainer webSocketContainer;
  
      public void sendMessage(URI endpointURI, String message) throws IOException, DeploymentException {
          Session session = webSocketContainer.connectToServer(MyClientEndpoint.class, endpointURI);
          session.getAsyncRemote().sendText(message);
      }
  }
  </code></pre>
  
  <p>For the initial HTTP handshake I want to add extra HTTP Headers to the request on the <strong><em>Client side</em></strong></p>
  
  <p>Is this possible?</p>
  
  <p>I know that this is possible on server side using <code>ServerEndpointConfig.Configurator.modifyHandshake</code>. Is there a similar solution on client side?</p>