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 do you associate a node id with a user identity #72

Open
zicodeng opened this issue Nov 9, 2019 · 1 comment
Open

How do you associate a node id with a user identity #72

zicodeng opened this issue Nov 9, 2019 · 1 comment

Comments

@zicodeng
Copy link

zicodeng commented Nov 9, 2019

I have user stored in database. When this user logs in and starts 1-on-1 chat with another user, we create a room for them. When the user joins, we get a peer joined event, but this peer CID is not associated with the user at all. What is the best way to associate node id with a user identity?

Also there seems to a significant delay when peer joined event is fired

Thanks in advance!

@zicodeng
Copy link
Author

zicodeng commented Nov 9, 2019

So here is my solution, not sure it is the best approach, happy to discuss with everyone here.

Similar to TCP 3-way handshake, I need other users to confirm that I have successfully joined the room first via peer joined event, then other users will broadcast this peer ID. If it happens to be my peer ID, that means I have successfully joined. Now, I can broadcast my identity to everyone in the room

Here is the repo: https://github.com/zicodeng/dchat, it has demo link in it

Thanks

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