-
Notifications
You must be signed in to change notification settings - Fork 454
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
Adding browser example with communication between peers #616
Conversation
Hey @svdo, Thanks for putting this example together. I had the same question. Assuming we get past this issue: If you deploy this example to a remote server (e.g. https://example.com), are you able to get the peers to connect? I tried with a very similar example and the peers discover each other but they don't connect. @jacobheun, any ideas? |
@alexcastillo Do you have code or logs to look at? There could be a number of reasons causing the issue. The quickest thing to maybe check is increasing the If that doesn't help can you open a new issue to discuss. I want to avoid splintering the discussion here. |
Thanks @jacobheun. Your suggestion didn't work so I'll go ahead an open a new issue later today. Thank you! |
By the way, I've been doing my work in TypeScript, so as a bonus I converted this example to TypeScript as well; may it help others :) |
I think this example is pretty much done. Do you want to merge it @jacobheun? |
(I think the build errors and coverage change are not due to this PR?) |
@svdo our plan is to create a repository for registering/cataloging community created examples / projects like this, it's being tracked at #512. As that's not yet ready, what I'd like to do is have you add this example to a standalone repo, and then add a link and brief summary of it to the examples readme here. Once we create the community repo/site, I can then add yours and any other examples that get added in the mean time there. |
Hmm I was hoping that your suggestion was going to end with something like "since we're not there yet we will merge this example and move it later" or something like that. I thought maybe this example adds enough value to justify being here. Reason I'm saying this is that I don't see myself converting and maintaining this code in the future, so it would be "instant legacy". |
The project I mentioned is still going to just reference projects/examples, not include them directly. I appreciate that you likely won't be able to maintain the example with new releases, but there is still value to having it and we can add metadata to the version it does support. We will eventually integrate some examples and projects into CI testing and help to keep those updated, but we unfortunately don't have the bandwidth to directly support updating an increasing list of them. If this still isn't something you're interested in considering we could look at amending the existing browser example to include dialing and sending data. |
Right, I completely understand that you're also mindful of the "bandwidth thing" :) I'll go ahead and post it to a repo of my own. I'll add the link here and close the pull request afterwards. |
Ok I moved the example to its own repo, here you go: https://github.com/svdo/js-libp2p-example-chat-in-the-browser. |
I'm trying to use libp2p-js to communicate between browser windows. I'm having some issues, so I thought I'd add an example of what I'm trying to accomplish.
This example is NOT working. You can only send one single message to the other peer, then it stops working.
Can somebody help me by telling me what I'm doing wrong? Thanks!!!