Skip to content

Commit

Permalink
Added support for IPv6 (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
leo authored Jun 15, 2018
1 parent ef45e6a commit e8378d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const http = require('http');
const path = require('path');
const fs = require('fs');
const {promisify} = require('util');
const {URL} = require('url');
const {parse} = require('url');
const dns = require('dns');
const os = require('os');

Expand Down Expand Up @@ -108,7 +108,9 @@ const parseEndpoint = str => {
return [str];
}

const url = new URL(str);
// We cannot use `new URL` here, otherwise it will not
// parse the host properly and it would drop support for IPv6.
const url = parse(str);

switch (url.protocol) {
case 'pipe:': {
Expand Down

0 comments on commit e8378d5

Please sign in to comment.