ipfs / ipfs/kubo

Enable Gateway on localhost IPv6 (ip4+ip6 by default)

Open
#5,905 8 comments 7 reactions 0 assignees View on GitHub
kind/enhancement topic/gateway
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

#### Version information:

0.4.18

#### Type:

enhancement

#### Description:

**What?** How do we feel about migrating default Gateway config to listen on ipv6 as well?
For now, this can be enabled manually via:

```console
$ ipfs config --json Addresses.Gateway '["/ip4/127.0.0.1/tcp/8080","/ip6/::1/tcp/8080"]'
```

**Why?** It is a cosmetic change that enables much shorter URLs for local gateway and shift focus towards IPFS paths:

> ![2019-01-08-125329_758x575_scrot](https://user-images.githubusercontent.com/157609/50833266-eb72ee00-1350-11e9-9c24-33399eda7c83.png)

**How?**

Current default:
```console
$ ipfs config --json Addresses.Gateway
/ip4/127.0.0.1/tcp/8080
```

Proposed change (arrays are supported since https://github.com/ipfs/go-ipfs-config/pull/11):
```console
$ ipfs config --json Addresses.Gateway
[
"/ip4/127.0.0.1/tcp/8080",
"/ip6/::1/tcp/8080"
]
```

Additional notes:
- To avoid `socket: address family not supported by protocol` error on systems without ipv6 we go-ipfs could detect runtime without ipv6 and ignore multiaddrs starting with `/ip6/`, as suggested in https://github.com/ipfs/go-ipfs/issues/1675#issuecomment-139111308
- Investigating vanity hostnames for localhost HTTP gateway: https://github.com/ipfs/in-web-browsers/issues/109
- **tl;dr**
> AFAIK only `127.0.0.1` and `::1` are whitelisted by browser vendors (eg. [firefox #903966](https://bugzilla.mozilla.org/show_bug.cgi?id=903966)) while `localhost` is not (that is why [Companion uses raw IP](https://github.com/ipfs-shipyard/ipfs-companion/pull/650#issuecomment-451167415))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.