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

Subdomain gateway support #9

Open
didnt1able opened this issue Sep 2, 2020 · 2 comments
Open

Subdomain gateway support #9

didnt1able opened this issue Sep 2, 2020 · 2 comments

Comments

@didnt1able
Copy link

didnt1able commented Sep 2, 2020

When accessing via a subdomain gateway it is unable to resolve

ipfs resolve -r /ipfs/bafybeidu5fa3wnoj6ixuluw6h5otbnsicgwbma7xhnao7zs3wpcn3nj7te/ipfs/bafybeiczbt5m3sox6r7drnzhg5dln33vffy372b42x2v7pmchncqrbbxxu: no link named "ipfs" under bafybeidu5fa3wnoj6ixuluw6h5otbnsicgwbma7xhnao7zs3wpcn3nj7te

Could change the hash replace to <cid>.ipfs.localhost:8080/#<decryption_key>-firstview

@jes
Copy link
Owner

jes commented Sep 2, 2020

Thanks, I haven't actually looked at IPFS in a long time.

From what you've said, in principle I agree. We'd want to detect if it's a subdomain gateway (How? Do we just check if the domain looks like ipfs.$foo? What about ipfs.io or other public non-subdomain gateways? Or are they subdomain gateways now too? Maybe we just check for a cid at the start of the domain?), and if it looks like it's a subdomain gateway, then do what you said.

It's unlikely I'll implement this but I'd merge a sensible pull request.

@didnt1able
Copy link
Author

didnt1able commented Sep 3, 2020

Could check with a regexp

^(http|https)://+(b[^.]{42,}\.ipfs\.+)

Im going to do some research on how to implement something like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants