This repository was archived by the owner on Nov 28, 2018. It is now read-only.
File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -118,12 +118,16 @@ function _connect(stomp) {
118
118
function _setupListeners ( stomp ) {
119
119
function _connected ( ) {
120
120
log . debug ( 'Connected to socket' ) ;
121
+ var headers = { } ;
121
122
if ( utils . really_defined ( stomp . login ) &&
122
123
utils . really_defined ( stomp . passcode ) ) {
123
- stomp_connect ( stomp , { login : stomp . login , passcode : stomp . passcode } ) ;
124
- } else {
125
- stomp_connect ( stomp ) ;
124
+ headers . login = stomp . login ;
125
+ headers . passcode = stomp . passcode ;
126
126
}
127
+ if ( utils . really_defined ( stomp [ "client-id" ] ) ) {
128
+ headers [ "client-id" ] = stomp [ "client-id" ] ;
129
+ }
130
+ stomp_connect ( stomp , headers ) ;
127
131
}
128
132
129
133
var socket = stomp . socket ;
@@ -236,15 +240,15 @@ function Stomp(args) {
236
240
this . ssl = args [ 'ssl' ] ? true : false ;
237
241
this . ssl_validate = args [ 'ssl_validate' ] ? true : false ;
238
242
this . ssl_options = args [ 'ssl_options' ] || { } ;
243
+ this [ 'client-id' ] = args [ 'client-id' ] || null ;
239
244
} ;
240
245
241
246
Stomp . prototype = new process . EventEmitter ( ) ;
242
247
243
248
/**
244
249
* Begin connection
245
- * @param {Object } optional headers
246
250
*/
247
- Stomp . prototype . connect = function ( headers ) {
251
+ Stomp . prototype . connect = function ( ) {
248
252
var self = this ;
249
253
_connect ( self ) ;
250
254
} ;
You can’t perform that action at this time.
0 commit comments