Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include port as a connection parameter for socket connections #604

Merged
merged 2 commits into from Jul 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -4,3 +4,5 @@ node_js:
- "0.10"
before_script:
- node script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres
before_install:
- npm install -g npm@~1.4.6
4 changes: 2 additions & 2 deletions lib/connection-parameters.js
Expand Up @@ -39,6 +39,7 @@ var parse = function(str) {
config.fallback_application_name = result.query.fallback_application_name;
}

config.port = result.port;
if(result.protocol == 'socket:') {
config.host = decodeURI(result.pathname);
config.database = result.query.db;
Expand All @@ -50,7 +51,6 @@ var parse = function(str) {
var auth = (result.auth || ':').split(':');
config.user = auth[0];
config.password = auth[1];
config.port = result.port;

var ssl = result.query.ssl;
if (ssl === 'true' || ssl === '1') {
Expand All @@ -66,7 +66,7 @@ var useSsl = function() {
return false;
case "prefer":
case "require":
case "verify-ca":
case "verify-ca":
case "verify-full":
return true;
}
Expand Down