@@ -193,6 +193,7 @@ class Connection {
193
193
* to the next pending observer.
194
194
*/
195
195
this . url = url ;
196
+ this . server = { address : url } ;
196
197
this . _pendingObservers = [ ] ;
197
198
this . _currentObserver = undefined ;
198
199
this . _ch = channel ;
@@ -453,6 +454,10 @@ class Connection {
453
454
_packable ( value ) {
454
455
return this . _packer . packable ( value , ( err ) => this . _handleFatalError ( err ) ) ;
455
456
}
457
+
458
+ setServerVersion ( version ) {
459
+ this . server . version = version ;
460
+ }
456
461
}
457
462
458
463
/**
@@ -464,6 +469,10 @@ class Connection {
464
469
*/
465
470
function connect ( url , config = { } ) {
466
471
let Ch = config . channel || Channel ;
472
+ const host = parseHost ( url ) ;
473
+ const port = parsePort ( url ) || 7687 ;
474
+ const completeUrl = host + ':' + port ;
475
+
467
476
return new Connection ( new Ch ( {
468
477
host : parseHost ( url ) ,
469
478
port : parsePort ( url ) || 7687 ,
@@ -473,7 +482,7 @@ function connect( url, config = {}) {
473
482
trust : config . trust || ( hasFeature ( "trust_all_certificates" ) ? "TRUST_ALL_CERTIFICATES" : "TRUST_CUSTOM_CA_SIGNED_CERTIFICATES" ) ,
474
483
trustedCertificates : config . trustedCertificates || [ ] ,
475
484
knownHosts : config . knownHosts
476
- } ) , url ) ;
485
+ } ) , completeUrl ) ;
477
486
}
478
487
479
488
export {
0 commit comments