Skip to content

Commit 78d7c06

Browse files
authored
fix: support API listening on ipv6 (#671)
Removing square brackets from hostname until the problem is fixed upstream in `stream-http`. Details in #668 (comment) Closes #668
1 parent 2f137e4 commit 78d7c06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

add-on/src/lib/ipfs-client/external.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ exports.init = async function (opts) {
88

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

0 commit comments

Comments
 (0)