docker-host
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -16,5 +16,5 @@ module.exports = function(remote) { | ||
if (protocol === 'unix' || protocol === 'http+unix') return {socketPath:host, protocol:'http:'} | ||
if (protocol === 'unix' || protocol === 'http+unix') return {socketPath:host, host:'localhost', protocol:'http:'} | ||
if (host === '0.0.0.0') host = 'localhost' | ||
return {host:host, port:parseInt(port, 10), protocol:protocol+':'} | ||
} | ||
} |
{ | ||
"name": "docker-host", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Tiny module that converts a host to docker (usually $DOCKER_HOST) to a standard http url", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,4 +25,4 @@ var tape = require('tape') | ||
tape('unix', function(t) { | ||
t.same(host('unix:///foo.sock'), {socketPath:'/foo.sock', protocol:'http:'}) | ||
t.same(host('/foo.sock'), {socketPath:'/foo.sock', protocol:'http:'}) | ||
t.same(host('unix:///foo.sock'), {socketPath:'/foo.sock', host:'localhost', protocol:'http:'}) | ||
t.same(host('/foo.sock'), {socketPath:'/foo.sock', host:'localhost', protocol:'http:'}) | ||
t.end() | ||
@@ -33,7 +33,6 @@ }) | ||
process.env.DOCKER_HOST = '' | ||
t.same(host(), {socketPath:'/var/run/docker.sock', protocol:'http:'}) | ||
t.same(host(), {socketPath:'/var/run/docker.sock', host:'localhost', protocol:'http:'}) | ||
process.env.DOCKER_HOST = 'unix:///env.sock' | ||
t.same(host(), {socketPath:'/env.sock', protocol:'http:'}) | ||
t.same(host(), {socketPath:'/env.sock', host:'localhost', protocol:'http:'}) | ||
t.end() | ||
}) | ||
4202
7
45