Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alt-Svc (HTTP Alternative Services) #144

Open
lidel opened this issue Mar 29, 2019 · 8 comments
Open

Alt-Svc (HTTP Alternative Services) #144

lidel opened this issue Mar 29, 2019 · 8 comments
Labels
topic/http-gateway topic/origin Issues related to Origin-based security

Comments

@lidel
Copy link
Member

lidel commented Mar 29, 2019

Alt-Svc is an Internet Standard (RFC7838) which allow an origin's resources to be authoritatively available at a separate network location, possibly accessed with a different protocol configuration.

TL;DR

The idea of Alt-Svc is for a website to be able to tell a client "For technical reasons you don't need to care about, please talk to me using [this other web address]."

The client optionally does so. (They don't have to.) If they do so, they do not change the address bar or give any sort of visual indication to the user.
src

Potential IPFS Use

Websites could announce they are available over IPFS in a way that does not require additional DNS lookups.

/ipfs/

$ curl -s -I -X GET https://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq.ipfs.dweb.link/ | grep -i Alt-Svc
Alt-Svc: ipfs="bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq"; ma=315360000; persist=1

/ipns/

$ curl -s -I -X GET https://wikipedia.org/ | grep -i Alt-Sv
Alt-Svc: ipns="wikipedia.org"; ma=3600; persist=1

Pros:

  • Location bar kept intact (same Origin!)
  • Following existing standard
    • Prior Art exists, Tor Browser will use .onion address if announced by a website
  • Enables smooth upgrade from HTTP to IPFS transport
  • Can be cached HSTS-style
  • No DNS TXT lookups

Cons:

  • Location bar kept intact (needs additional indicator that IPFS was used)
  • Requires initial hit to HTTP server
  • Relies on native support in browser itself
    • There is no API for WebExtension to register itself as a handler

References

@lidel lidel added the topic/origin Issues related to Origin-based security label Mar 29, 2019
@da2x
Copy link

da2x commented Mar 29, 2019

Ideally, ipfs would standardize on a new service identifier (h2 stands for http/2) that accepts a CID or IPNS name without requiring to specify a gateway hostname. Something like: Alt-Svc: ipns="en.wikipedia.org"; ma=864000; persist=1 and Alt-Svc: ipfs="base32-cidv1"; ma=2700; persist=1.

Browsers currently require h2 services to present a valid TLS certificate for the current origin. Standardizing a new service identifier would allow us to lift that requirement without compromising the requirements of h2 services. Content integrity in IPFS is guaranteed by the content-hash in the CID which the origin that transmits the Alt-Svc header vouches for; so we don’t need the certificate to prevent third-parties from modifying the content.

@bertrandfalguiere
Copy link

Prior Art exists, Tor Browser will use .onion address if announced by a website

It's live! I just read about https://blog.torproject.org/new-release-tor-browser-95, and figured it could be a good idea to share with IPFS, then I found this issue.

In IPFS-enabled browsers, not having to download IPFS Companion, keeping the exact same user flow, and still seeing the good old www.foo.com to access a familiar website would make grand-ma using IPFS (without her ever having heard about it).
This is a major UX improvement.

IPFS crawlers/indexers could also index wikipedia.org and other Web.2 websites if they provide the header.

Location bar kept intact (needs additional indicator that IPFS was used)

Tor Browser does the thing below for onion alternatives. IPFS-enabled browsers can probably take inspiration from it:
image

@bertrandfalguiere
Copy link

Relies on native support in browser itself
There is no API for WebExtension to register itself as a handler

Is this still true in Firefox and Chrome?

@lidel
Copy link
Member Author

lidel commented Feb 13, 2021

@bertrandfalguiere there is a basic redirect-based API in Firefox, but none in Chrome yet.
Theipfs:// "work" if you have Companion in Chrome, but it relies on creative hackery that works around the lack of WebExtension API.

We collaborate with Igalia to bridge that gap in both specs and vendor implementations:

As for the usefulness of Alt-Svc, I believe #179 is more powerful in the context of what IPFS does and that we have many gateways that could act as fallback/mirrors.

@bertrandfalguiere
Copy link

The provided link doesn't work. Luckily there's a copy on the Wayback Machine: https://web.archive.org/web/20210115180343/https://blog.ipfs.io/2021-01-15-ipfs-and-igalia-collaborate-on-dweb-in-browsers/

@jessicaschilling
Copy link
Contributor

@bertrandfalguiere Thanks for surfacing the broken link - fixed now.

@lidel
Copy link
Member Author

lidel commented Feb 4, 2022

Quick note based on recent discussions:

  • Potential downside of Alt-Svc is dependency on ALPNs from IANA and being limited to protocol upgrade – no way to link to different representation/metadata (eg. "i want this as block|car|dag-json with IPLD Data Model" etc)

@Seirdy
Copy link

Seirdy commented Nov 1, 2022

Also see dnslink-std/community#2. Quoted:


SVCB DNS resource records (RRs) were introduced somewhat recently. They inform user-agents that a given resource exists at another endpoint, possibly with extra parameters. Functionality closely mirrors the Alt-Svc standard. A profile of SVCB exists in HTTPS RRs; Encrypted Client Hello and HTTP/3 are the main use-cases today.

To give IPNS-accessible services familiar names, I think SVCB is a better long-term solution than DNSLink.

A related issue for the InterPlanetary Name System is Issue 144 for the IPFS web browsers integration group; it discusses the viability of using Alt-Svc for this.

POSSE note from https://seirdy.one/notes/2022/10/25/dnslink-and-svcb-dns-resource-records/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/http-gateway topic/origin Issues related to Origin-based security
Projects
None yet
Development

No branches or pull requests

5 participants