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

Cannot connect on non host network types #1

Closed
doitandbedone opened this issue Jun 3, 2020 · 12 comments
Closed

Cannot connect on non host network types #1

doitandbedone opened this issue Jun 3, 2020 · 12 comments

Comments

@doitandbedone
Copy link
Owner

doitandbedone commented Jun 3, 2020

Decription:
When using non host network types, web UI gets stuck on loading and eventually fails to connect prompting to retry.

Logs:

Running at http://localhost:8090
rtc:added servers
rtc:inited peer connection (True)
rtc:set flag
rtc:onsuccessanswer
ICE state: Checking
ICE state: Failed

Been in contact with the Agent's main developer and seems this is related to: bbc/brave#43

There's also a side discussion here:
https://github.com/anthonyangel/agentdvr-docker/issues/2

Workaround:
Run the container in host network type.

@doitandbedone
Copy link
Owner Author

At this point seems WebRTC's port selection is to blame as it picks ports that may not be forwarded on the container causing connection to fail. Host network allows to translate host's port profile which in turn may have ports more readily available.

@ispysoftware
Copy link
Collaborator

I've added some code into the most recent update to agent that will check for a file called turn.json in the application root directory. If it exists it'll read that in and add the contents to the ICE server list.
To use this with Docker you'd need to package a turn server (maybe coturn?) and start it with long term credentials configured and then write turn.json which should contain:

{"urls":"turn:localhost:3148?transport=udp", "credential": "somepassword", "username": "someusername"},{"urls":"turn:localhost:3148?transport=tcp", "credential": "somepassword", "username": "someusername"}

Agent will load this in when it starts up.

I haven't tested this here yet but i think it should resolve the issue. Also will need to expose and publish the port that coturn is running on.

@doitandbedone
Copy link
Owner Author

Cool, I'm a bit busy but as soon as I get the time I'lll review and test. Thanks for all the hard work!

@doitandbedone
Copy link
Owner Author

@ispysoftware
I installed a local coturn server, however, I am not able to get agent to even try to connect, I added the turn.json at the root. When debugging chrome://webrtc-internals/ I still see ispy trying to connect to Google's stun servers but nothing on my local (I checked logs on coturn, using testing page: https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ does seem to work and see traffic). Are there any logs I could look at to know if the file is being read and if something wrong may be happening?

Thanks!

@ispysoftware
Copy link
Collaborator

yeah it should output
Loaded TURN JSON
to the local log

  • i'm trying to get it to use a built in turn server so this may not be necessary anyway.

@doitandbedone
Copy link
Owner Author

I see. I'll try a few other times see if I did something wrong but keep us updated!

Thank you!

@ispysoftware
Copy link
Collaborator

I've got it working - will update it probably tomorrow

@doitandbedone
Copy link
Owner Author

Perfect! Will wait anxiously! Haha.

doitandbedone added a commit that referenced this issue Jul 15, 2020
doitandbedone added a commit that referenced this issue Jul 15, 2020
@doitandbedone
Copy link
Owner Author

Closed as per 04cf704.

@doitandbedone
Copy link
Owner Author

Seems the issue still persists on Linux. I tested this on mac and seems completely fine, not sure why it would be different. @ispysoftware What OS' did you have a chance to test this on?

@doitandbedone doitandbedone reopened this Jul 15, 2020
@doitandbedone doitandbedone changed the title Cannot connect on non host network types Cannot connect on non host network types (Linux) Jul 15, 2020
@doitandbedone
Copy link
Owner Author

Hmm, seems the Dockerfile didn't pull the latest version, still is in 2.8.1.0. Perhaps a caching issue, I'll look into it.

@doitandbedone doitandbedone changed the title Cannot connect on non host network types (Linux) Cannot connect on non host network types Jul 15, 2020
@doitandbedone
Copy link
Owner Author

Re-closing and opening another issue.

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

2 participants