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

add ICE to server #44

Merged
merged 4 commits into from
Apr 29, 2020
Merged

add ICE to server #44

merged 4 commits into from
Apr 29, 2020

Conversation

mjsobrep
Copy link
Contributor

@mjsobrep mjsobrep commented Apr 27, 2020

In reference to #39 and #24. This adds the default google stun servers. Combined with something like this You can get the system to work over the web in most situations.

I'm putting this in as a draft for now. Hardcoding in the stun servers is probably not what anyone wants. I also don't have TURN in there yet. I think for TURN what I am going to do is allow users to specify a service to call to get TURN credentials via whatever means the user asks for (REST, permanent, etc.). I will allow a flag to be passed into the webrtc server nodes whether to use that or not.

The alternative would be to pass all of the ICE info from the client to the server through the existing messaging architecture. That actually seems nicer for my applications, but quite a bit harder to implement and not as flexible for other users.

Let me know your thoughts.

A few important links:

@mjsobrep mjsobrep changed the title add stun to server add ICE to server Apr 27, 2020
commit 5b3a562
Author: Michael Sobrepera <[email protected]>
Date:   Mon Apr 27 13:04:01 2020 -0400

    more stupid typos

commit aa364a2
Author: Michael Sobrepera <[email protected]>
Date:   Mon Apr 27 13:02:19 2020 -0400

    fixed the same typo in the rest of the file

commit 4257019
Author: Michael Sobrepera <[email protected]>
Date:   Mon Apr 27 13:01:03 2020 -0400

    fixed typo in python import of service

commit 165c0d3
Author: Michael Sobrepera <[email protected]>
Date:   Mon Apr 27 12:59:02 2020 -0400

    fixed launch file wrong name in param

commit 9d7189b
Author: Michael Sobrepera <[email protected]>
Date:   Mon Apr 27 12:58:19 2020 -0400

    made python node runable

commit 39a51e7
Author: Michael Sobrepera <[email protected]>
Date:   Mon Apr 27 11:38:35 2020 -0400

    changed to using a service and made a python demo source
@mjsobrep mjsobrep marked this pull request as ready for review April 27, 2020 17:09
@mjsobrep
Copy link
Contributor Author

mjsobrep commented Apr 27, 2020

I think this is ready to review. It works for me, but I have admittedly not tested all edge cases. In fact, the only test I have run is through this launchfile with the setup described in that repository using coturn as the turn server and the remote endpoint programmed here.

I did not add ICE servers to the example app since I can't imagine how that would be accessed in such a way as to need any sort of NAT traversal. But that wouldn't be hard to do if desired.

I tested the TURN functionality using this trick

Copy link
Collaborator

@roehling roehling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the implementation, that looks quite good already.
I have just one question: is there a particular reason why you added an extra Python node that is queried for the TURN server, instead of just adding all that logic to the server node itself?

@mjsobrep
Copy link
Contributor Author

Splitting that logic out allows someone else to easily replace the extra node with whatever they want and just make their own launch file. I implemented it using a rest api to get credentials. That is probably the most general purpose approach, but it is not the only approach that is viable. Someone else might have a database on their turn server with fixed usernames and passwords or a rest api that has a different authentication method, JWT for example. I didn't want to make people have to drop into the webrtc server to make those changes.

@roehling
Copy link
Collaborator

Understood.

Is this ready to merge, or do you still want to work on this PR?

@mjsobrep
Copy link
Contributor Author

Ready to merge

@roehling roehling merged commit 9ed2847 into RobotWebTools:develop Apr 29, 2020
@roehling
Copy link
Collaborator

Thank you for your work!

@mjsobrep mjsobrep deleted the server-stun branch April 29, 2020 12:38
@mjsobrep
Copy link
Contributor Author

Happy to help out. Is it possible to update the built version installed via package managers?

@roehling
Copy link
Collaborator

Yes, I will push a new release to ROS soon(ish).

@roehling
Copy link
Collaborator

ros/rosdistro#24639
ros/rosdistro#24640

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

Successfully merging this pull request may close these issues.

2 participants