@@ -193,6 +193,7 @@ class Connection {
193193 * to the next pending observer.
194194 */
195195 this . url = url ;
196+ this . server = { address : url } ;
196197 this . _pendingObservers = [ ] ;
197198 this . _currentObserver = undefined ;
198199 this . _ch = channel ;
@@ -453,6 +454,10 @@ class Connection {
453454 _packable ( value ) {
454455 return this . _packer . packable ( value , ( err ) => this . _handleFatalError ( err ) ) ;
455456 }
457+
458+ setServerVersion ( version ) {
459+ this . server . version = version ;
460+ }
456461}
457462
458463/**
@@ -464,6 +469,10 @@ class Connection {
464469 */
465470function connect ( url , config = { } ) {
466471 let Ch = config . channel || Channel ;
472+ const host = parseHost ( url ) ;
473+ const port = parsePort ( url ) || 7687 ;
474+ const completeUrl = host + ':' + port ;
475+
467476 return new Connection ( new Ch ( {
468477 host : parseHost ( url ) ,
469478 port : parsePort ( url ) || 7687 ,
@@ -473,7 +482,7 @@ function connect( url, config = {}) {
473482 trust : config . trust || ( hasFeature ( "trust_all_certificates" ) ? "TRUST_ALL_CERTIFICATES" : "TRUST_CUSTOM_CA_SIGNED_CERTIFICATES" ) ,
474483 trustedCertificates : config . trustedCertificates || [ ] ,
475484 knownHosts : config . knownHosts
476- } ) , url ) ;
485+ } ) , completeUrl ) ;
477486}
478487
479488export {
0 commit comments