code: public static URI toWebsocket(CharSequence inputUrl, String query) throws URISyntaxException {
          if (query == null) {
              return toWebsocket(new URI(inputUrl.toString()));
          }
          return toWebsocket(new URI(inputUrl.toString() + '?' + query));
      }
docs: Convert to WebSocket <code>ws</code> or <code>wss</code> scheme URIs
  <p>
  Converting <code>http</code> and <code>https</code> URIs to their WebSocket equivalent
  
  @param inputUrl the input URI
  @param query    the optional query string
  @return the WebSocket scheme URI for the input URI.
  @throws URISyntaxException if unable to convert the input URI