STUN Server setup in AWS instance

1,545 views
Skip to first unread message

vijay

unread,
Dec 24, 2013, 7:21:47 AM12/24/13
to eas...@googlegroups.com
Irrespective of my configuration in config.js, "config.experimentalStunServerEnable = true / false;" screen sharing is working between systems in different firewalls.
How to check whether it is using STUN server or not?

And even if "config.experimentalStunServerEnable = true;" in some cases Im getting black patch instead of streaming. What could be the reason? (I will be able to see BLOB data in console)

Eric Davies

unread,
Dec 26, 2013, 4:43:01 PM12/26/13
to eas...@googlegroups.com
Hi Vijay,

That experimentalStunServerEnable tells the server to use an internal stun server instead of external ones. Unless you have a real need to use an internal stun server, I would advise against using that setting.

If your two clients were in different subnets and you didn't need a TURN server, then one or more STUN servers was used to figure out the self reflexive addresses used to establish the peer connection. STUN servers aren't proxy servers. You can use a network monitoring tool to see the brief usage of the STUN servers. 

If you are seeing "black", it typically means that a peer-to-peer connection can not be established and that you need to use a TURN server to act as an intermediary. Turn servers are proxy servers. You can get a free turn server account from the eyeball networks guys at http://turn.anyfirewall.com/. If you haven't already, I'd recommend reading a few articles on how ICE works, it's not that complicated and is essential to getting a webrtc app to work on the internet. Anybody got a goof reference?

Eric


vijay

unread,
Dec 27, 2013, 12:23:48 AM12/27/13
to eas...@googlegroups.com
Hi Eric,

Thanks for your reply.

As you mentioned Im trying to create a TURN server. and even I registered in http://turn.anyfirewall.com/ , but I want to create my own TURN server running on AWS instance.
For this I have downloaded "turnserver-3.1.6.0.tar.gz" from "https://code.google.com/p/rfc5766-turn-server/" and created setup in AWS instance and it is running without any errors on console.

As part of this setup, I have done
1) created an AWS instance with 2 private IPs
2) Associated 2 Elastic IPs to the private IPs
3) Associated Elastic IPs to eth0 and eth1
4) and used the above 2 IPs to start server using the below command
sudo turnserver -syslog -a -L 10.0.0.xxx -L 10.0.0.xxx -X 54.254.xxx.xxx -f -min-rt=32355 -max-port=65535 -user=username:password -r realm -log-le=stdout -v

And to connect to this TURN server, I have updated my Config.js file in easyRTC with the below lines...
config.externalIceServers = [
{url:"turn:user...@54.254.xxx.xxx", credential:"password"}
];

Still Im seeing the same "black". I think it is not going through TURN server.
is any thing I have missed here? and how to test?

Looking forward for your help

Regards,
Vijay

Eric Davies

unread,
Dec 27, 2013, 1:28:41 AM12/27/13
to eas...@googlegroups.com
Hi Vijay,

There are are two places your problem can be; the first step is to isolate it down to one place. Is it in the easyrtc configuration or in the rfc5766 configuration?

1) You mentioned you registered to get any turn server from the eyeball networks people. Verify that you can use it with easyrtc so that you can trust your your easyrtc configuration. If if you don't use their service in the long term, just having a no-fuss service around for situations like this is invaluable. All hail the wonderful eyeball network people!

2) Were you aware that Oleg (the RFC5766 guy) provides an AWS image to save you from most of the work? See https://groups.google.com/forum/#!topic/discuss-webrtc/X-OeIUC0efs .

If you've isolated your problem to 2, then you need to ask questions on the rfc5766 turnserver group. Oleg and the people there are really good about answering questions, but he isn't shy about telling people to read the instructions first if they ask dopey questions.

Eric.


vijay

unread,
Dec 30, 2013, 7:00:23 AM12/30/13
to eas...@googlegroups.com
Hi Eric,

Im talking about easyRTC configurations.

As you said I tried to connect to eyeball Turn server, but not be able to get the result that Im looking for. The same black screen is comming.
I think the problem is with my easyRTC configuration. You can see the configuration that have used to connect.

config.externalIceServers = [
{url:"turn:turn.anyfirewall.com:3478?transport=udp",username: "vijay",credential:"xxx"},
{url:"turn:turn.anyfirewall.com:443?transport=tcp",username: "vijay",credential:"xxx"}
];

Can you please share me any working sample (need not be easyRTC) if you have?

Regards,
Vijay

Eric Davies

unread,
Dec 30, 2013, 1:07:52 PM12/30/13
to eas...@googlegroups.com
I'm not at the office at the moment so I can't access our servers for that working sample. 
However, your list of iceservers appears to be the correct format to me.
My only question is whether that list is making it's way down to your client.
If you send me a URL to your client, I can try it and see if the ice server info is making it's way down based on the packets received.

vijay

unread,
Dec 30, 2013, 11:41:39 PM12/30/13
to eas...@googlegroups.com
Hi Eric,

I sent URLs to your email.

and for your referance.. As I mentioned earlier, im getting BLOB data in the receiver screen but not the streeming.

<video autoplay="" id="callerVideo" src="blob:https%3A//54.254.213.211%3A8443/f90cfc65-5084-4b7b-98dd-692f4ea6560e"></video>

Regards,
Vijay

Eric Davies

unread,
Dec 31, 2013, 11:58:03 AM12/31/13
to eas...@googlegroups.com
Hi Vijay,

I just tried your URLs but I got "This webpage is not available" message.

That src blob you are seeing just means that a peer connection object has been set up on the receiving side, it doesn't mean that data is actually flowing on any ports yet.

On another tack, let's assume you are using EasyRTC version 1.*. Then to set up your ice configuration, you should be using Rod's new instructions found at:
https://github.com/priologic/easyrtc/blob/master/docs/easyrtc_server_ice.md
note: the below call
  easyrtc.setOption("appIceConfig", myIceConfig);
goes into your server.js file. I don't believe the old config.js approach is supported in version 1.*. This is probably something we should put in the change logs (Rod? please correct me if I'm wrong).


vijay

unread,
Jan 2, 2014, 7:56:16 AM1/2/14
to eas...@googlegroups.com
Hi Eric,

Thanks for the update.

and with this changes it is working fine. Thanks a lot for you kind support.

Regards,
Vijay
Reply all
Reply to author
Forward
0 new messages