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

Slow discovery of peers on localhost #7

Open
pasqui23 opened this issue Sep 3, 2020 · 27 comments
Open

Slow discovery of peers on localhost #7

pasqui23 opened this issue Sep 3, 2020 · 27 comments
Labels
bug Something isn't working

Comments

@pasqui23
Copy link
Contributor

pasqui23 commented Sep 3, 2020

I have an application that emits peer events very slowly.
As in,if I open 2 tabs in the same browser,the second tabs discover the first after a few minutes,but the fist discover the second after a few hours.

@RangerMauve
Copy link
Owner

Could you try testing version 2.0.1 to see if it's better?

@RangerMauve RangerMauve added the bug Something isn't working label Sep 3, 2020
@tinchoz49
Copy link
Contributor

Hey @RangerMauve, sorry, are you sure was published? https://www.npmjs.com/package/hyperswarm-web I cannot see it in versions

@RangerMauve
Copy link
Owner

@tinchoz49 Whoops, I must have forgotten to publish after tagging. Try 2.0.2 instead. 😅

@pasqui23
Copy link
Contributor Author

pasqui23 commented Sep 8, 2020

Updated to 2.0.2,still having the same problem

@RangerMauve
Copy link
Owner

Weird. Lets debug this a bit further.

  1. Are you getting anything interesting in the dev tools? Like errors or warning messages.
  2. Are connections actually being made to the signalling servers?
  3. What browser version are you using?
  4. What data are you trying to replicate?

@pasqui23
Copy link
Contributor Author

pasqui23 commented Sep 8, 2020

  1. No,no message at all
  2. I have bootstrap:["ws://localhost:4799"],how do I check it?
  3. Chromium 83.0.4103.116
    4: WHat you need toknow exactly?

@tinchoz49
Copy link
Contributor

Hey @pasqui23, it could be helpful a demo repository with your failing test, we can try to find the issue from that point.

@pasqui23
Copy link
Contributor Author

pasqui23 commented Sep 8, 2020

@tinchoz49
Copy link
Contributor

https://github.com/pasqui23/.hswm-bug gets 404

@pasqui23
Copy link
Contributor Author

pasqui23 commented Sep 8, 2020

It's a private repo,now you should be able to open it.

@tinchoz49
Copy link
Contributor

thank you

@tinchoz49
Copy link
Contributor

https://github.com/pasqui23/.hswm-bug/blob/master/src/index.js#L29

there is a typo in the bootstrap url, it should be: ws://localhost:4977

@pasqui23
Copy link
Contributor Author

pasqui23 commented Sep 8, 2020

I'm using it without TLS,wouldn't break oon wss?

@tinchoz49
Copy link
Contributor

I didn't write wss..

You wrote localost, should be localhost

@pasqui23
Copy link
Contributor Author

pasqui23 commented Sep 8, 2020

The risks of programming at midnight ...

@pasqui23
Copy link
Contributor Author

pasqui23 commented Sep 9, 2020

Fixed typo,but discovery is still slow

@pasqui23
Copy link
Contributor Author

Still important to me and I don't know how to start debugging hyperswarm.Any tips,@tinchoz49 @RangerMauve ?

@tinchoz49
Copy link
Contributor

I don't see the slow discovery

Peek 2020-09-15 11-19

@RangerMauve
Copy link
Owner

I don't have time at the moment to look too deeply into this due to work, but you could try setting up breakpoints inside the simple peer code to see if you're actually getting peers through it.

@pasqui23
Copy link
Contributor Author

pasqui23 commented Sep 15, 2020

It looks like the _onIceCandidate ( https://github.com/feross/simple-peer/blob/0dd27ee83d615a8ff0eb48c49ed4917c9d6e2ff1/index.js#L904 ) method fires several times without discovering any peer,is that normal?

@tinchoz49
Copy link
Contributor

which browser are you using?

@pasqui23
Copy link
Contributor Author

@tinchoz49 still the same.I'm debuuging using VSCode's Debugger for chrome extension

@tinchoz49
Copy link
Contributor

I cannot reproduce your error, in chrome I get a connection in less of 1 second: #7 (comment)

@pasqui23
Copy link
Contributor Author

@RangerMauve where do you suggest I put breakpoints? My selection of breakpoints interrupts right after continuing from the previous breakpoint.

@pasqui23
Copy link
Contributor Author

I suspect it's something with [https://en.wikipedia.org/wiki/Internet_in_Italy](Italian Internet) as other people in Italy could replicate the problem.

@pasqui23
Copy link
Contributor Author

@RangerMauve I did set up a breakpoint on Peer._onIceCandidate and it did fire up but still no discovery
The about:webrtc of this session so that someone more familiar with webrtc can look it up.

@RangerMauve
Copy link
Owner

You could try setting up custom TURN servers for your app with a service like XirSys to improve browser-to-browser connectivity. Else you might want to find a consultant that can figure out why WebRTC isn't working for you. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants