-
Notifications
You must be signed in to change notification settings - Fork 239
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
Multi-node capability #12
base: master
Are you sure you want to change the base?
Conversation
Added export/import of answer/offers (via FileSaver js library) Added nicknames (needed for distinguishing different recipients) Added network display of recipients + individual send/latency/close buttons Documented in README
@shadiakiki1986 Hey, this sounds great, thank you very much! I'll review and test it soon. |
@cjb any update? |
Ah, I'm sorry I never replied to this. The feature's nice, but it looks like there's lots of code duplication and style issues that it'd be good to avoid. Unless we have a volunteer to do the cleanup perhaps it's best to leave this on a separate branch for people to use.. |
|
||
#### Multi-node capability | ||
|
||
serverless-webrtc-multinode.html adds on top of serverless-webrtc.html the functionality of many-to-many connections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please line wrap to 80 cols to match the rest of the file
|
||
serverless-webrtc-multinode.html adds on top of serverless-webrtc.html the functionality of many-to-many connections. | ||
|
||
It just does so by making a new WebRTC peer connection for each new pair of users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can drop "just"
|
||
It just does so by making a new WebRTC peer connection for each new pair of users. | ||
|
||
Peer connections are either ''Guest'' connections (Bob the recipient), or ''Host'' connections (Alice the sender) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use real double quotes "
put a period at the end of the sentence
these issues come up below too
/* THIS IS BOB, THE ANSWERER/RECEIVER */ | ||
|
||
function SWGuestConnection() { | ||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these files/funcs have bad/inconsistent indentation in general
you could try fixing it with something like clang-format -i -style=file
counterparty: null, | ||
lastTimestamp: null, | ||
latency: null, | ||
pc2 : new RTCPeerConnection(cfg, con), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no spaces before the :
guestConnections: null, | ||
p1: null, | ||
init: function(un,pc2a2,p11) { | ||
var self=this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing spaces around the =
this func has inconsistent indentation
}, | ||
close: function() { | ||
this.pc2.close(); | ||
if(this.echoId!=null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing spaces in the right place
you should compare to null using !==
instead. or just go with a truthy check like if (this.echoid) {
.
Hi. I added the ability to chat with multiple users in your serverless-webrtc project. It's basically just pulling out code from your js/serverless-webrtc.js file into two classes SWHostConnection.js and SWGuestConnection.js. The main code is in separate html and js files than your original serverless-webrtc.html and js/serverless-webrtc.js. In a nutshell, this is just extending your connection to an array of connections.