holepunchto / hyperdrive

Hyperdrive is a secure, real time distributed file system
Apache License 2.0
1.86k stars 135 forks source link

browser support #166

Closed ghost closed 6 years ago

ghost commented 7 years ago

I've almost got hyperdrive running in the browser using random-access-idb. However, hyperdrive calls crypto_kdf_derive_from_key which is not supported in sodium-javascript.

millette commented 7 years ago

Ping - fixed upstream, yay!

DouglasMeyer commented 7 years ago

It looks like hyperdrive isn't working in the browser again. I'm fairly new to this tech stack, but http://karissa.github.io/hyperdrive-ui and dat both seem to not work. I'm trying to find a simple example, but this is what I've got so far: https://jsfiddle.net/Douglas_Meyer/5kn8rxwb/2/

Thanks for your help.

okdistribute commented 7 years ago

Have you tried dat-js?

DouglasMeyer commented 7 years ago

The jsfiddle I lined to uses the 6.2.0 build of dat-js, and (from what I could gather) that pointed me to here as the source of the problem. I could be wrong in my use of dat-js or hyperdrive; so any help would be appreciated. Thanks!

ghost commented 6 years ago

Not sure about other people's issues, but for my own purposes hyperdrive works in the browser now using random-access-idb.

okdistribute commented 6 years ago

@substack do you have an example of it somewhere that you can share with everyone? thanks!

aral commented 6 years ago

@substack I’d also appreciate it if there is an example. Dat-js is deprecated and I’m finding it difficult to find a getting started path for using hypercore/hyperdb/hyperdrive universally (from Node.js and browser).

RangerMauve commented 6 years ago

@aral I've got hyperdrive working with random-access-idb in my demo for dat-archive-web. Here's where I create the hyperdrive instance.

If you want it to be "universal", you should choose a storage for node, then alias that storage to random-access-idb in your package.json browser field with browserify, or using whatever aliasing you'd use in webpack/babel if you're using that.

aral commented 6 years ago

@RangerMauve Thanks, I appreciate it! Will check it out :)