WebRTC connection fails

cheinan

Member
Regardless of the Internet quality, on certain networks WebRTC connection is always fails.
From 7 different networks we tested in 4 WebRTC connection is always fails.
It fails in one wifi and other 3 are cellular.
Are we using STUN and TURN in our FlashPhone 0.5.25 media server?
Is there anything we can do to improve the success of WebRTC connections?

Thanks
Cheinan
 

Max

Administrator
Staff member
Try to setup TURN server as described in the docs:
https://flashphoner.com/docs/wcs5/w...nd_testing-firewall_traversal-turn_server.htm

Here you can find example how it works:
https://wcs5-eu.flashphoner.com/cli...l-streaming/firewall-traversal-streaming.html
https://wcs5-eu.flashphoner.com/cli...sal-streaming/firewall-traversal-streaming.js
This example uses our turn server turn.flashphoner.com as TCP relay on port 443.
So if you close all UDP traffic excepting DNS, WebRTC should work via the TURN server.
 

cheinan

Member
I installed Coturn TURN SERVER on our Linux server
On the same server were our WCS is installed.
And i see that the same certificates which are imported to WCS server, can be used by the TURN server.
In the turnserver.conf file:
How do i figure what is the values of the path of the certificates files that was imported to WCS :
cert=?
pkey=?
And what is the value of:
pkey-pwd=?

Another question about the Port 443 config:
In this post:
https://forum.flashphoner.com/threads/is-there-way-to-use-web-call-server-over-firewall.10789/
you wrote: To get this working you have to configure
TURN server on port 443
and You can also configure WCS directly use 443 port in server.properties file.
If i do both can it cause a conflict?
if i configure WCS directly to use 443, do i still need to install and configure HAproxy?

Thanks
Cheinan
 

Max

Administrator
Staff member
If i do both can it cause a conflict?
if i configure WCS directly to use 443, do i still need to install and configure HAproxy?
HA proxy will not be able to recognize TURN traffic
So it won't work.
You should either use two servers
1. Use two different servers, first for WCS:443, second for TURN server.
or
2. Use two different network interfaces on the same server, i.e 192.168.1.5:443 (wcs), 192.168.1.6:443 (turn)
or
3. Bind WCS and TURN on different ports.
WCS 443, TURN 4443
or vise versa
To configure WCS port you can change server.properties
How do i figure what is the values of the path of the certificates files that was imported to WCS
You can try to extract certificates from file WCS_HOME/conf/wss.jks using JDK keytool
https://flashphoner.com/docs/wcs5/w...ment-websocket_ssl-ssl_certificate_import.htm
https://docs.oracle.com/javase/6/docs/technotes/tools/solaris/keytool.html
 

cheinan

Member
Hello Max
I used two different network interfaces on the same server and it is working fine
But i have another problem:
When i change in the server.properties to:
wss.port=443 And connect by: wss://myWCSdomain:443
I cold not connect to WCS via WSPlayer, only by WebRTC
And when i change it back to:
wss.port=8443 And connect by: wss://myWCSdomain:8443
I can connect by both
Is there is solution for it? Can i use both? like:
wss.port=443
wss.port=8443

Thanks
Cheinan
 

Max

Administrator
Staff member
Code:
I cold not connect to WCS via WSPlayer, only by WebRTC
If you check player.js code, you can find connection string.
Code:
Flashphoner.createSession(...);
Just set port 443 here as urlServer parameter.
Example:
Code:
Flashphoner.createSession({urlServer:'wss://host:443'});
 

cheinan

Member
That is exactly what i did.
The problem is when i use:
wss://host:443
I cold not connect to WCS via WSPlayer, only by WebRTC
And when i use:
wss://host:8443
I can connect by both
Is there a solution for it? like for example: can i set in the server.properties both like:
wss.port=443
wss.port=8443
and use for WebRTC this port: 443
and for WSPlayer this port: 8443
?

Thanks
Cheinan
 

Max

Administrator
Staff member

Attachments

Max

Administrator
Staff member
Please check wsplayer in your demo dashboard. Does it work as expected with port 443?
 

cheinan

Member
I cheeked it and in your demo dashboard it work as expected on wsplayer with port 443.
But i have big problem that may be is connected to the first one:
When WCS configured to work on port 443 in one IP
it blocks Turnserver on port 443 on different IP
WCS runs JAVA process PID = 3074 on all IPS: 0.0.0.0:443

In the flashphoner.properties file:
ip and ip_local are configured to the same needed one IP.

How do i make WCS to run his JAVA process only on this one IP ?

Thanks
Cheinan
 
Last edited:
Top