Skip to content

WebRTC revisions and updates including the addition of secure connections. - #1429

Merged
digisomni merged 14 commits into
vircadia:webappfrom
ctrlaltdavid:dev/webrtc-revisions
Nov 20, 2021
Merged

WebRTC revisions and updates including the addition of secure connections.#1429
digisomni merged 14 commits into
vircadia:webappfrom
ctrlaltdavid:dev/webrtc-revisions

Conversation

@ctrlaltdavid

@ctrlaltdavid ctrlaltdavid commented Oct 26, 2021

Copy link
Copy Markdown
Collaborator
  • Fix STUN servers used by WebRTC.
  • Fix handling of ICE candidates received from client.
  • Add server setting to enable/disable WebRTC client connections.
  • Add secure WebSocket support to the WebRTC signaling channel.
    In order to use the microphone a web app needs to be served as HTTPS. And an HTTPS page requires WebSocket connections be WSS.
  • Use avatar position for "no skeleton" orb if the head position isn't available.
  • Fix domain server and assignment client crashes when app doesn't cleanly disconnect.

Works in conjunction with SDK PR: vircadia/vircadia-web-sdk#50

image

Cert names are now: vircadia-cert.key, etc.

@ctrlaltdavid ctrlaltdavid added the do not merge do not merge due to issues or pending updates label Oct 26, 2021
This was referenced Oct 26, 2021
@ctrlaltdavid ctrlaltdavid added needs CR (code review) needs testing (QA) The PR is ready for testing web sdk Related to the Vircadia Web SDK and removed do not merge do not merge due to issues or pending updates labels Oct 27, 2021
@ctrlaltdavid ctrlaltdavid changed the title WebRTC Revisions WebRTC revisions. Oct 27, 2021
@digisomni
digisomni requested a review from daleglass October 28, 2021 21:56
Comment thread domain-server/src/DomainServer.cpp
Comment thread domain-server/src/DomainServer.cpp
Comment thread domain-server/src/DomainServer.cpp Outdated
Comment thread domain-server/src/DomainServer.cpp
this));

auto dsDirPath = PathUtils::getAppLocalDataPath();
const QString KEY_FILENAME = "cert.key";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Constant should probably be on top.

Also it would be nice to have a more unique name than "cert.key". How about "vircadia-webrtc-cert.key"?

@ctrlaltdavid ctrlaltdavid Oct 29, 2021

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Same comment re constant locations.

Regarding the file name...
The cert isn't necessarily just for WebRTC: it could also be used to secure the server settings page as HTTPS.
The cert is for the DNS domain name being used as the address to connect to the domain server at sop could, in theory, be used for other things also. This might change if we switch to using IP address certs or some other SSL method. Perhaps vircadia-cert.key might be suitable.
See also: #1432

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My thought re: the cert name: I'd like something unique because I found myself trying to figure out where's a given cert for a given program a few times, and there are cases where you may end up with multiple certs in the same directory. It's just nice to clearly know what a cert is for at a glance.

But yeah, vircadia-cert.key works for me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I just realized one issue... It's entirely possible that multiple domains on the same server may use a different cert. We should probably keep that in mind now as that will most certainly become a thing.

Comment thread libraries/networking/src/webrtc/WebRTCSignalingServer.cpp Outdated
@digisomni digisomni added the unmerged-dev A project being developed in parallel to master, to be merged at a later date. label Oct 30, 2021
@digisomni digisomni linked an issue Oct 30, 2021 that may be closed by this pull request
@digisomni digisomni added CR Approved At least one code reviewer has approved the PR. and removed needs CR (code review) labels Oct 31, 2021
@digisomni digisomni added the CR Approved At least one code reviewer has approved the PR. label Nov 13, 2021
@ksuprynowicz

Copy link
Copy Markdown
Contributor

For some reason it looks like 1429 solves high CPU usage bug. Can someone else build interface from this PR so we can connect to the server and see if audio and avatar mixers work?

@ksuprynowicz

Copy link
Copy Markdown
Contributor

I tested it with Kalila. It indeed solves CPU usage bug.

@ctrlaltdavid

Copy link
Copy Markdown
Collaborator Author

Note that this PR is against the webapp branch which is currently based on master as at 8 Oct.

@digisomni digisomni removed the QA Approved The PR has been tested successfully. label Nov 13, 2021
@ksuprynowicz

Copy link
Copy Markdown
Contributor

The connection works now, but it's possible to crash server using web-sdk. To cause crash, you need at least two users logged in. Then one user opens multiple tabs and connects, mutes and unmutes each one a few times and closes them without disconnecting. It causes server to crash.
Server logs:
http://oaktown.pl/tmp/assignment_crash.txt
http://oaktown.pl/tmp/domain_crash.txt

@ctrlaltdavid

ctrlaltdavid commented Nov 15, 2021

Copy link
Copy Markdown
Collaborator Author

The domain-server.exe crash happens 15 - 30s after closing or reloading the browser tab with the SDK example app connected to the domain server - if the WebRTC connection isn't explicitly disconnected. The following SDK example app PR prevents the crash but doesn't fix the underlying problem: vircadia/vircadia-web-sdk#61

@ctrlaltdavid ctrlaltdavid added needs CR (code review) needs testing (QA) The PR is ready for testing and removed CR Approved At least one code reviewer has approved the PR. labels Nov 20, 2021
@ksuprynowicz

Copy link
Copy Markdown
Contributor

I just built and tested it on Linux and I can confirm. Crashes are gone now.

@digisomni digisomni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using a Windows 10 Interface + Chrome and testing against both the dev-1 (Windows 10) and dev-2 (Ubuntu 18.04) test servers, I couldn't get crashing to happen. Maybe there was one or two oddities with the example not connecting on the first try but otherwise it seems stable.

@digisomni digisomni added QA Approved The PR has been tested successfully. and removed needs testing (QA) The PR is ready for testing labels Nov 20, 2021
@digisomni digisomni changed the title WebRTC revisions. WebRTC revisions and updates including the addition of secure connections. Nov 20, 2021
@digisomni digisomni added CR Approved At least one code reviewer has approved the PR. and removed needs CR (code review) labels Nov 20, 2021
@digisomni
digisomni merged commit 66fe21e into vircadia:webapp Nov 20, 2021
@ctrlaltdavid
ctrlaltdavid deleted the dev/webrtc-revisions branch November 20, 2021 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CR Approved At least one code reviewer has approved the PR. QA Approved The PR has been tested successfully. rebuild rebuild through the GithubActions unmerged-dev A project being developed in parallel to master, to be merged at a later date. web sdk Related to the Vircadia Web SDK

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants