stomp-js / stompjs

Javascript and Typescript Stomp client for Web browsers and node.js apps
Apache License 2.0
775 stars 81 forks source link

react native error: trust anchor for certification path not found, when trying stomp socket connection , i used @stomp/stompjs lib. any way to ignore sign certificate? #624

Closed mmahdibyt closed 7 months ago

mmahdibyt commented 9 months ago
import { Client } from "@stomp/stompjs";

 const client = new Client({

    brokerURL: "wss://192.168.1.160:9090/ws",

    connectHeaders: {"Authorization": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyIiwiYXV0aCI6IlJPTEVfR1VBUkQiLCJ1c2VyX2lkIjoxOCwiaGFzaF9pZCI6IjgxODgzMDk5MjkwMzQzNSIsImlhdCI6MTcwNzIwMDcyNCwiZXhwIjoxNzA4MDY0NzI0fQ.8dEv0ceBh5WzD9y9v6U_ijk6FlHHaMBLFpjiaPCkfEYY0_h1UgxuoABSwGS7luCJKk7AMdWEFUTklq5D5XeBWQ" },
    debug: function(str) {
      console.log("DEBUG:", str);
    },
    reconnectDelay: 0,
    heartbeatIncoming:5000,
    heartbeatOutgoing:5000,
appendMissingNULLonIncoming:true,
    forceBinaryWSFrames:true,
    connectionTimeout:21000,

  });
  client.onStompError = (frame) => {
    console.error("Stomp Error:", frame.headers.message);
  };
  client.onConnect = () => {
    console.log("Connected to Stomp");

> 

> `};`
kum-deepak commented 7 months ago

Closing this issue as it is not related to this library.