libsignal-protocol-javascript icon indicating copy to clipboard operation
libsignal-protocol-javascript copied to clipboard

Wrong environment detected in meteor package

Open mrinaldhar opened this issue 9 years ago • 8 comments

I'm trying to use this library on the client side of a meteor package, but it keeps detecting the environment as NodeJS, which causes some things like require('fs') to fail, and errors appearing in the browser console.

The relevant part from my package.js file for meteor is:

api.addFiles([
		'client/lib/libsignal.js',
		'client/helper.js',
		'client/store.js'
	], 'client');

Any idea what could be going wrong?

mrinaldhar avatar Jun 03 '17 18:06 mrinaldhar

If it helps, signal-protocol has been made for browser support from the ground up and should be usable as-is.

derhuerst avatar Jun 03 '17 19:06 derhuerst

Yeah, I used it in a regular HTML file, and it works fine. I need to now implement the same thing as a package in meteor, and the only issue is the environment being detected as Node, when it clearly should be detected as web (since its being included in the client environment).

mrinaldhar avatar Jun 03 '17 19:06 mrinaldhar

@mrinaldhar That sounds like an issue with signal-protocol. If you'd like, open an issue over there, and we'll see if we can look into why it's not detecting the environment correctly in meteor.

elsehow avatar Jun 04 '17 03:06 elsehow

Hi,

@mrinaldhar I have a meteor app that I'd really like to integrate Signal's peer-to-peer encryption into. Could you please guide me into how I can do that? Thanks.

eminx avatar Mar 02 '18 14:03 eminx

Hey @eminx , sorry for the late response. You can absolutely use this library to do that. I did that as a Google Summer of Code project with Rocket Chat last year, but we ended up not using Signal for some other reasons.

I built this as a simple tool to understand how Signal works, you can take a look at the code to help you with your work: https://mrinaldhar.com/signal/

mrinaldhar avatar May 12 '18 09:05 mrinaldhar

Thanks @mrinaldhar ! I look into it, but I'd appreciate if you could guide me a little more indeed :)

Is it possible?

eminx avatar May 15 '18 22:05 eminx

@eminx I'm interested in the same thing but completely lost where to start. It almost seems as this library is geared towards setting up your own independent signal service, which is not my interest. I want to use Signal to send automated / service messages to users from the server side of a meteor.js app. These library seems to show how you encrypt/decrypt the message, but completely lost on how you "register" the phone number associated with your service and get the encrypted message to the user's phone or desktop. @mrinaldhar Is this something you did before? Your link is very helpful to understand how the message encryption works, but I can't see the link between a service sender/receiver and an app user sender/receiver.

raymondcarl avatar Jul 02 '18 19:07 raymondcarl

I'm gonna close this. Meteor is not a supported platform. The forums are a better place to have this kind of conversation: https://whispersystems.discoursehosting.net/

scottnonnenberg-signal avatar Jul 03 '18 01:07 scottnonnenberg-signal