Skip to content

Commit

Permalink
fix: support API listening on ipv6 (#671)
Browse files Browse the repository at this point in the history
Removing square brackets from hostname until the problem is fixed
upstream in `stream-http`.

Details in
#668 (comment)

Closes #668
  • Loading branch information
lidel authored Jan 30, 2019
1 parent 2f137e4 commit 78d7c06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion add-on/src/lib/ipfs-client/external.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ exports.init = async function (opts) {

const url = opts.apiURL
const protocol = url.protocol.substr(0, url.protocol.length - 1) // http: -> http
const api = IpfsApi({ host: url.hostname, port: url.port, protocol })
const host = url.hostname.replace(/[[\]]+/g, '') // temporary fix for ipv6: https://github.com/ipfs-shipyard/ipfs-companion/issues/668
const api = IpfsApi({ host, port: url.port, protocol })
return api
}

Expand Down

0 comments on commit 78d7c06

Please sign in to comment.