@@ -19,14 +19,15 @@ const driverVersion = packageJson.version;
1919 * Handshake response
2020 */
2121class Handshake extends PluginAuth {
22- constructor ( auth , getSocket , multiAuthResolver , reject ) {
22+ constructor ( auth , host , getSocket , multiAuthResolver , reject ) {
2323 super ( null , multiAuthResolver , reject ) ;
2424 this . sequenceNo = 0 ;
2525 this . compressSequenceNo = 0 ;
2626 this . auth = auth ;
2727 this . getSocket = getSocket ;
2828 this . counter = 0 ;
2929 this . onPacketReceive = this . parseHandshakeInit ;
30+ this . host = host ;
3031 }
3132
3233 start ( out , opts , info ) { }
@@ -160,10 +161,9 @@ class Handshake extends PluginAuth {
160161 Handshake . writeAttribute ( out , '_client_version' , encoding ) ;
161162 Handshake . writeAttribute ( out , driverVersion , encoding ) ;
162163
163- const address = cmd . getSocket ( ) . address ( ) . address ;
164- if ( address ) {
164+ if ( this . host ) {
165165 Handshake . writeAttribute ( out , '_server_host' , encoding ) ;
166- Handshake . writeAttribute ( out , address , encoding ) ;
166+ Handshake . writeAttribute ( out , this . host , encoding ) ;
167167 }
168168
169169 Handshake . writeAttribute ( out , '_os' , encoding ) ;
0 commit comments