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

how to get a list of peers accessing the same document? #398

Open
michaelpalumbo opened this issue Nov 8, 2024 · 0 comments
Open

how to get a list of peers accessing the same document? #398

michaelpalumbo opened this issue Nov 8, 2024 · 0 comments

Comments

@michaelpalumbo
Copy link

michaelpalumbo commented Nov 8, 2024

is it possible to get a list of all peers currently working with the same document?

while having 3 browser tabs open, and successfully accessing the same document, i tried:

const repo = new Repo({
    network: [new BrowserWebSocketClientAdapter('ws://localhost:3030')],
    storage: new IndexedDBStorageAdapter("automerge");
});

// skipping the handle setup code....

await handle.whenReady();
console.log(repo.peers) 

but this returns an empty array.

  • also is there an event listener for catching when new peers connect or disconnect?*
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

1 participant