如何使用ssl / tls在node js中使用stomp-client?

时间:2018-09-01 10:45:25

标签: node.js stomp

这是我的代码:

var Stomp = require('stomp-client');
var destination = '/queue/someQueueName';
var client = new Stomp('wss://ovs.kontakt.io', 8083, 'test', '********');

client.connect(function(sessionId) {
  console.log('connected');

    // client.subscribe(destination, function(body, headers) {
    //   console.log('This is the body of a message on the subscribed queue:', body);
    // });
    // client.publish(destination, 'Oh herrow');
});

在我的回复中,出现以下错误:

 at _exceptionWithHostPort (util.js:1014:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)

0 个答案:

没有答案