Skip to content

Commit fdbadd6

Browse files
author
Dan Thurman
committed
Adding support for vhost host header (required in Stomp 1.1 protocol)
1 parent d3cd072 commit fdbadd6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/stomp.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ function _setupListeners(stomp) {
131131
if (utils.really_defined(stomp["client-id"])) {
132132
headers["client-id"] = stomp["client-id"];
133133
}
134+
if (utils.really_defined(stomp["vhost"])) {
135+
headers["host"] = stomp["vhost"];
136+
}
134137
stomp_connect(stomp, headers);
135138
}
136139

@@ -258,6 +261,9 @@ function Stomp(args) {
258261
this.ssl_validate = args['ssl_validate'] ? true : false;
259262
this.ssl_options = args['ssl_options'] || {};
260263
this['client-id'] = args['client-id'] || null;
264+
if(typeof args.vhost !== 'undefined'){
265+
this.vhost = args['vhost'] ;
266+
}
261267
};
262268

263269
// ## Stomp is an EventEmitter

0 commit comments

Comments
 (0)