Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Is this suitable for the browser? #34

Closed
JustinDrake opened this issue Nov 23, 2016 · 3 comments
Closed

Is this suitable for the browser? #34

JustinDrake opened this issue Nov 23, 2016 · 3 comments

Comments

@JustinDrake
Copy link

I am interested in encrypting and decrypting IPFS communications client-side and wondered if js-libp2p-secio is suitable for the browser. Some of my concerns are:

  • When doing npm install, I notice that some dependencies have C/C++ that needs compiling. Presumably those are Node.JS-only dependencies
  • The code is written with ES6 which will need compiling down to ES5 for wide browser support.

On the other hand, I see there is a test file called browser.js described as secio browser <-> nodejs so this is promising!

@dignifiedquire
Copy link
Member

The code should run out of the box on latest Firefox and Chrome. Even without transpiling. The major blocker for other browsers is webcrypto, which is being tracked here: libp2p/js-libp2p-crypto#18

@JustinDrake
Copy link
Author

JustinDrake commented Nov 23, 2016

Thanks for pointing out the webcrypto dependency. When you write "out of the box" how does that work? Should I be using http://browserify.org?

@dignifiedquire
Copy link
Member

When you write "out of the box" how does that work? Should I be using http://browserify.org?

Yes you can either use webpack or browserify. You can find examples for js-ipfs on how to do this here, which has the same setup as the js-libp2p modules.

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

No branches or pull requests

2 participants