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

Wont work between machines #4

Closed
mitra42 opened this issue Aug 28, 2017 · 11 comments
Closed

Wont work between machines #4

mitra42 opened this issue Aug 28, 2017 · 11 comments

Comments

@mitra42
Copy link

mitra42 commented Aug 28, 2017

Another problem with the shared-editing-demo that would be good to document if its the intention ...

If you load it up (current git repository version NOT the re-compiled version which doesnt work at all) it advertises both the 127.0.0.1:12345 address, but also a local network address e.g. 192.168.0.123:12345 If you try and reach that address from another machine it complains about "Could not read property "generate" of undefined (full stacktrace below). I think I saw a similar bug reported elsewhere that related to the server being HTTP rather than HTTP, but if it won't work on HTTP across a LAN then it might be good to document that :-)

@mitra42
Copy link
Author

mitra42 commented Aug 28, 2017

The stack trace is as follows (note i posted the wrong one earlier and deleted).

Uncaught TypeError: Cannot read property 'generateKey' of undefined at Object.exports.generateKey (app.js:70748) at Object.generateKeyPair (app.js:71551) at Object.exports.generateKeyPair (app.js:71067) at waterfall (app.js:113096) at nextTask (app.js:29146) at exports.default (app.js:29156) at Function.exports.create (app.js:113095) at waterfall (app.js:129517) at nextTask (app.js:29146) at next (app.js:29153)

@mitra42
Copy link
Author

mitra42 commented Aug 28, 2017

Note the other generateKey error reported this weekend by someone else was at ipfs/js-ipfs#964 (comment)

@daviddias
Copy link
Member

It is supposed to work between machines and it will work if you load both of them through Localhost. It is a WebCrypto limitation, read more at:

@mitra42
Copy link
Author

mitra42 commented Aug 28, 2017

It won't work currently ...
STR (on Mac).
git clone https://github.com/ipfs-labs/shared-editing-demo.git.
cd shared-editing-demo.git.
npm install.
DO NOT run npm run compile - it will create a version that fails with #3.
npm start.
On Chrome (it fails in Firefox immediately).
http://localhost:12345.
It opens up a text editor - View/Developer/Javascript Console to see the errors.
Same thing on second browser (on a different machine)
Type on one browser (either)
Notice in console on BOTH browsers:
client.js:18 WebSocket connection to 'wss://sfo-1.bootstrap.libp2p.io/' failed: Error during WebSocket handshake: Unexpected response code: 502

(Note if you now wait 5 minutes, both Chrome pages should crash with "Aw Snap" illustrating the bug in #2

@daviddias
Copy link
Member

I got it working. I've also published the latest to this hash https://ipfs.io/ipfs/QmUS49q6Hr6r61aciF3wPJd1xivstjFnyUWbUnrYom8dHE/ can you try it?

@mitra42
Copy link
Author

mitra42 commented Aug 31, 2017

Following that links seems to load ok, but no sharing happens (Not between browser tabs on Chrome; between Chrome & Firefox on same machine or back and forth with another machine.
Console logs don't show any problems except the WebSocket errors reported on other Issues.

@daviddias
Copy link
Member

@mitra42 I wonder if that is because of your Wifi set up and possible double NAT/Firewall. I've tested it on 2 computers and in two home network setups and worked fine. Just tested again, might try again?

@mitra42
Copy link
Author

mitra42 commented Aug 31, 2017

Possible ... but this was working before (on these machines to themselves), I'm seeing the same problem and both with the IPFS and localhost version. I'm seeing it to the bootstrap nodes and errors reported on sfo-1 and sfo-2.
On Chrome I'm also seeing:
websocket errors on star-signal.cloud....
complaints about emitter.setMaxListeners
"underlying socket has been closed" errors.

I'm just now (on same browser as had all those errors) starting to see some text from someone else popping up on the window -
Can't test on Firefox as crashes browser (problem #2 ) usually within a minute.

@mitra42
Copy link
Author

mitra42 commented Aug 31, 2017

And now its working between those two machines (using the version on IPFS and between that and the localhost version ... no change in network here, so there is something intermittent going on.

I suggest leaving this Issue open until can find out what the intermittency is that is causing it.

@daviddias
Copy link
Member

The issue you saw there was me redeploying the star-signal :) all good here then!

@vasa-develop
Copy link

Just checked it out...it's working indeed on chrome

@mitra42 mitra42 closed this as completed Apr 26, 2019
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

3 participants