code: private void initializeStream(URI uri, Token token, long sessionIdleTimeout, long idleTimeout)
              throws SaltException {
          try {
              URI adjustedURI = new URI(uri.getScheme() == "https" ? "wss" : "ws",
                      uri.getSchemeSpecificPart(), uri.getFragment())
                      .resolve("ws/" + token.getToken());
              websocketContainer.setDefaultMaxSessionIdleTimeout(sessionIdleTimeout);
  
              // Initiate the websocket handshake
              synchronized (websocketContainer) {
                  session = websocketContainer.connectToServer(this, adjustedURI);
                  session.setMaxIdleTimeout(idleTimeout);
              }
          } catch (URISyntaxException | DeploymentException | IOException e) {
              throw new SaltException(e);
          }
      }
docs: Connect the WebSocket to the server pointing to /ws/{token} to receive events.
  
  @throws SaltException in case of an error during stream initialization