How to use the @stomp/stompjs.Stomp.over function in @stomp/stompjs

To help you get started, we’ve selected a few @stomp/stompjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github viadee / sonarQuest / sonarQuest-frontend / src / app / services / websocket.service.ts View on Github external
initializeWebSocketConnection() {
    this.closeWebSocket();

    const ws = new SockJS(this.serverUrl);
    this.stompClient = Stomp.over(ws);
    const that = this;
    this.stompClient.connect({}, function(frame) {
      this.chatStomp = that.stompClient.subscribe('/chat', message => {
        const eventUserDto: EventUserDto = JSON.parse(message.body);
        that.eventService.addEvent(eventUserDto);
      });
    });
  }

@stomp/stompjs

STOMP client for Javascript and Typescript

Apache-2.0
Latest version published 1 year ago

Package Health Score

60 / 100
Full package analysis