hypercore-protocol / cli

A CLI for peer-to-peer file sharing using the Hypercore Protocol.
MIT License
205 stars 17 forks source link

http server --allow-origin argument to set cors headers #54

Closed ghost closed 2 years ago

ghost commented 3 years ago

This patch adds CORS headers when --allow-origin is given to the hyp drive http command. The headers are the same as ipfs uses which have probably been tested against many different scenarios by now.

With this patch, I can use fetch() in a web app to load proxied content from a hyper:// archive.