Configuring STUN/TURN servers using Janus

1,843 views
Skip to first unread message

Jason Kang

unread,
Aug 7, 2020, 1:18:19 AM8/7/20
to meetecho-janus
I have tested atyenoria docker locally, which worked perfectly fine when I build the service for videoroom. After testing, I started using an AWS EC2 with the same docker but it won't connect. 

I am using TURN servers provided by Xirsys. And I have configured my janus like below

janus = new Janus({
  server: janusDockerServer,
  iceServers: [
  {
    urls: STUN_SERVER_ADDRESS,
    },
  {
    username: TURN_USER_NAME,
    credential: TURN_CREDENTIAL,
    urls: TURN_URL
  },

The problem is that when I start my connection on Chrome, it works, but I lose the connection in about 15 seconds with a message like below

[WARN] [4775674024086402] ICE failed for component 1 in stream 1, but let's give it some time... (trickle pending, answer received, alert not set)
[WARN] [4775674024086402] ICE failed for component 1 in stream 1, but we're still waiting for some info so we don't care... (trickle pending, answer received, alert not set)

Is there a way for me to change settings? I have read somewhere that I can also configure STUN/TURN on the server side--like inside the docker container--as well. Please let me know if you have any suggestions or solutions.

Best,
Jason Kang

Shivansh Talwar

unread,
Aug 7, 2020, 1:24:10 AM8/7/20
to meetecho-janus
Make sure to specify same stun and turn details in janus.conf file on docker
Also make sure stun and turn works without problem using https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/

Jason Kang

unread,
Aug 7, 2020, 2:18:53 AM8/7/20
to meetecho-janus

I checked the website and tested my STUN and TURN servers. They can gather candidates fine, but I get an error message like this 
returned an error with code=701: TURN host lookup received error, which does not look right to me because it throws an error while successfully gathering candidates. 

Shivansh Talwar

unread,
Aug 7, 2020, 2:30:24 AM8/7/20
to meetecho-janus
So about stun and turn url are you using domain or ipv4 address?

Jason Kang

unread,
Aug 7, 2020, 2:35:34 AM8/7/20
to meetecho-janus
I am using ipv4 address. And I cant find janus.conf file on docker either. Can you tell me where the actual file is? is it janus.c?

Shivansh Talwar

unread,
Aug 7, 2020, 3:07:18 AM8/7/20
to meetecho-janus
Normally you can find it in /opt/janus/

Shivansh Talwar

unread,
Aug 7, 2020, 3:18:38 AM8/7/20
to meetecho-janus
You can use docker image i compiled it works fine https://hub.docker.com/r/shivanshtalwar0/janusgateway

Lorenzo Miniero

unread,
Aug 7, 2020, 3:50:48 AM8/7/20
to meetecho-janus
What?! NO!
Do NOT set STUN and TURN in janus.jcfg unless you REALLY need to, which is most of the times NEVER!

Please do not give misleading instructions thast can severely impact performance, and rad the FAQ first:

Lorenzo

Shivansh Talwar

unread,
Aug 7, 2020, 4:09:10 AM8/7/20
to meetecho-janus
So you saying we don't need to set stun and turn both on janus side? I have tried it without stun and turn it does not work when you are not on lan or you just saying we need only stun on janus side, please correct me if i got this wrong.

Jason Kang

unread,
Aug 16, 2020, 9:10:30 AM8/16/20
to meetecho-janus
@Lorenzo

Could you please explain what `you're asking Janus to gather relay candidates for ITSELF` means in the FAQ? Actually, when I looked at the source code of the videoroom demo, I did not see any ICE servers specified there, which could mean that I am using the default STUN server, but I thought your Janus server has some ice servers in the janus.jcfg file. 

virendra singh

unread,
Aug 16, 2020, 9:22:30 AM8/16/20
to Jason Kang, meetecho-janus
Hi Jason, 

I can help you on this just apply this once in etc/janus/janus.jcfg

in nat session of Janus.

        #stun_server = stun.l.google.com

        #stun_port = 19302

        stun_server = "stun.voip.eutelia.it"

        stun_port = 3478

        nice_debug = true

        full_trickle = true

        ice_lite = true

        ice_tcp = true




nat_1_1_mapping = "public_ip of your server"


--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/7dad9527-c3e5-4b99-8f29-d806bde004bfn%40googlegroups.com.


--
VIRENDRA SINGH
Software Engineer

Jason Kang

unread,
Aug 16, 2020, 9:47:23 AM8/16/20
to virendra singh, meetecho-janus
appreciate the prompt response. but what does it mean for Janus to gather candidate for itself?

Neil Young

unread,
Aug 16, 2020, 9:58:08 AM8/16/20
to meetecho-janus
It simply means, that the STUN/TURN servers, you configuring in janus.cfg or which are dynamically allocated via REST API, are just for Janus itself. Clients of the Janus server need to care about this on their own.
Reply all
Reply to author
Forward
0 new messages