File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -75,15 +75,19 @@ var getLibpgConString = function(config, callback) {
75
75
params . push ( "dbname='" + config . database + "'" ) ;
76
76
}
77
77
if ( config . host ) {
78
- if ( config . host != 'localhost' && config . host != '127.0.0.1' ) {
79
- //do dns lookup
80
- return require ( 'dns' ) . lookup ( config . host , function ( err , address ) {
81
- if ( err ) return callback ( err , null ) ;
82
- params . push ( "hostaddr=" + address )
83
- callback ( null , params . join ( " " ) )
84
- } )
78
+ if ( ! config . host . indexOf ( "/" ) ) {
79
+ params . push ( "host=" + config . host ) ;
80
+ } else {
81
+ if ( config . host != 'localhost' && config . host != '127.0.0.1' ) {
82
+ //do dns lookup
83
+ return require ( 'dns' ) . lookup ( config . host , function ( err , address ) {
84
+ if ( err ) return callback ( err , null ) ;
85
+ params . push ( "hostaddr=" + address )
86
+ callback ( null , params . join ( " " ) )
87
+ } )
88
+ }
89
+ params . push ( "hostaddr=127.0.0.1 " ) ;
85
90
}
86
- params . push ( "hostaddr=127.0.0.1 " ) ;
87
91
}
88
92
callback ( null , params . join ( " " ) ) ;
89
93
} else {
You can’t perform that action at this time.
0 commit comments