title: Websocket Wss connection failed
body: <p>everyone. I'm trying to apply the websocket to our server.</p>
  <p>I used the websocket provided by Javax, succeeded in connecting in my local environment, and sent a message to the client.</p>
  <p>However, as a result of applying it to the server, the connection is failing. The difference from the local environment is that the protocol uses wss instead of ws.</p>
  <p>Currently, our server is using SSL. Is it related to this?</p>
  <p>Please Help.
  Please help!</p>
  <p>Code at client side (Javascript)</p>
  <pre><code>```
  var protocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
  var hostPort = location.host;
  var webSocket = new WebSocket(protocol+&quot;//&quot;+hostPort+$B.path+&quot;/websocket&quot;);
  ```
  </code></pre>
  <p>Code at Server side (Java)</p>
  <pre><code>@ServerEndpoint(&quot;/websocket&quot;)
  public class WebSocket {
      private static final Logger logger = LogManager.getLogger(WebSocket.class);
      public static Session session;
      @OnOpen
      public void handleOpen(Session session) {
          this.session = session;
          String username = &quot;&quot;;
          try {
              session.getBasicRemote().sendText(&quot;You are connected. Your ID is&quot; + session);
              // sessions.put(&quot;&quot;,session);
          } catch (Exception e) {
              logger.error(&quot;Error on open web socket&quot;, e);
          }
      }
  </code></pre>
  <p>Error at the browser console :</p>
  <pre><code>VM1435:4 WebSocket connection to 'wss://framptest.bizflow.com/bizflowappdev/websocket' failed: 
  </code></pre>