Skip to content

Websocket infinite reconnection loop #485

@mlazarenkoivy

Description

@mlazarenkoivy

Hi! I have the infinite reconnection loop. I've read the documentation. I've tried to do everything according to it but I still have this reconnection loop

const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const fs = require('fs');
const path = require('path');

const app = express();

Object.assign(global, { WebSocket: require('websocket').w3cwebsocket });

var StompJs = require('@stomp/stompjs');

const client = new StompJs.Client({
  brokerURL: 'ws://localhost:3001/stream/ws',
  debug: function (str) {
    console.log(str);
  }
});

client.onConnect = function (frame) {
  console.log('Connection STOMP from nodejs openned');
};

client.onStompError = function (frame) {
  console.log('Broker reported error: ' + frame.headers['message']);
  console.log('Additional details: ' + frame.body);
};

client.activate();

app.listen(3001, () => console.log('Mock server listening on port 3001'));

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions