igorb3st / rfc5766-turn-server

rfc5766-turn-server
Other
0 stars 0 forks source link

Run the "turnserver /etc/turnserver.conf " but it seems that the coturn does not work #146

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.install coturn
2.vi /etc/turnserver.conf
3.turnserver /etc/turnserver.conf

What is the expected output? What do you see instead?
I have installed the coturn(4.4.5.1) and configure the turnserver.conf.After I 
run the "turn server /etc/turnserver.conf" ,I open the ip address which I 
configure with the port in my browser.
This is what I configure the turn server.conf

external-ip:<the ip address of my server >
user=u1:p1
user=u2:p2

This is what I get when I run the "turn server -c /etc/turnserver.conf" command

turnserver -c /etc/turnserver.conf
0: log file opened: /var/log/turn_15913_2015-06-03.log
0:
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.4.5.1 'Ardee West'
0:
Max number of open files/sockets allowed for this process: 65536
0:
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 21500 (approximately)
0:

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 is not supported
0: TURN/STUN ALPN is not supported
0: Third-party authorization (oAuth) supported
0: GCM (AEAD) supported
0: OpenSSL compile-time version: OpenSSL 1.0.1m 19 Mar 2015
0:
0: SQLite is not supported
0: Redis is not supported
0: PostgreSQL is not supported
0: MySQL supported
0: MongoDB is not supported
0:
0: SCTP is not supported
0: Default Net Engine version: 2 (UDP thread per network endpoint)

=====================================================

0: Domain name:
0: Default realm:
0:
CONFIGURATION ALERT: you specified long-term user accounts, (-u option)
        but you did not specify the long-term credentials option
        (-a or --lt-cred-mech option).
        I am turning --lt-cred-mech ON for you, but double-check your configuration.
0:
CONFIGURATION ALERT: you did specify the long-term credentials usage
 but you did not specify the default realm option (-r option).
                Check your configuration.
0: WARNING: cannot find certificate file: turn_server_cert.pem (1)
0: WARNING: cannot start TLS and DTLS listeners because certificate file is not 
set properly
0: WARNING: cannot find private key file: turn_server_pkey.pem (1)
0: WARNING: cannot start TLS and DTLS listeners because private key file is not 
set properly
0: NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: ===========Discovering listener addresses: =========
0: Listener address to use: 127.0.0.1
0: Listener address to use: <the ip address of my server >
0: =====================================================
0: Total: 1 'real' addresses discovered
0: =====================================================
0: NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: ===========Discovering relay addresses: =============
0: Relay address to use: <the ip address of my server >
0: =====================================================
0: Total: 1 relay addresses discovered
0: =====================================================
0: pid file created: /var/run/turnserver.pid
0: IO method (main listener thread): epoll (with changelist)
0: WARNING: I cannot support STUN CHANGE_REQUEST functionality because only one 
IP address is provided
0: Wait for relay ports initialization...
0:   relay <the ip address of my server > initialization...
0:   relay <the ip address of my server > initialization done
0: Relay ports initialization done
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=0 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=1 created
0: IO method (udp listener/relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=2 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=3 created
0: turn server id=128 created
0: IO method (udp listener/relay thread): epoll (with changelist)
0: turn server id=129 created
0: Total UDP servers: 2
0: Total General servers: 4
0: IO method (auth thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)
0: IO method (admin thread): epoll (with changelist)

What version of the product are you using? On what operating system?
the cot urn (4.4.5.1). RedHat Enterprise Linux(RHEL)5.6

Please provide any additional information below.

Original issue reported on code.google.com by ghwil...@gmail.com on 3 Jun 2015 at 3:37

GoogleCodeExporter commented 8 years ago
I open the ip address which I configure with the port 3478 in the browser after 
I start the turnserver,but the address can not connect.

Original comment by ghwil...@gmail.com on 3 Jun 2015 at 3:57

GoogleCodeExporter commented 8 years ago
Admin connection works only over HTTPS protocol. You did not set the TLS 
options (key, certificate). So HTTPS is not working, for that exactly reason.

Original comment by mom040...@gmail.com on 3 Jun 2015 at 4:50

GoogleCodeExporter commented 8 years ago
@mom040...@gmail.com

I have changed the turnserver.conf as follow

listening-port=3478
tls-listening-port=5349
listening-ip=<the ip address of my server >
relay-ip=<the ip address of my server >
external-ip=<the ip address of my server >
relay-threads=10
lt-cred-mech
user=xlsgrid:0
user=u2:1
max-bps=1024
cert=/etc/turn_server_cert.pem
pkey=/etc/turn_server_pkey.pem
mobility
no-cli

After I run the "turnserver -c turnserver.conf",it output as follow 

turnserver -c turnserver.conf
0: log file opened: /var/log/turn_3207_2015-06-03.log
0:
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.4.5.1 'Ardee West'
0:
Max number of open files/sockets allowed for this process: 65536
0:
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 21500 (approximately)
0:

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 is not supported
0: TURN/STUN ALPN is not supported
0: Third-party authorization (oAuth) supported
0: GCM (AEAD) supported
0: OpenSSL compile-time version: OpenSSL 1.0.1m 19 Mar 2015
0:
0: SQLite is not supported
0: Redis is not supported
0: PostgreSQL is not supported
0: MySQL supported
0: MongoDB is not supported
0:
0: SCTP is not supported
0: Default Net Engine version: 2 (UDP thread per network endpoint)

=====================================================

0: Config file found: /etc/turnserver.conf
0: Listener address to use: <the ip address of my server >
0: Relay address to use: <the ip address of my server >
0: 1024 bytes per second allowed per session
0: Config file found: /etc/turnserver.conf
0: Domain name:
0: Default realm:
0:
CONFIGURATION ALERT: you did specify the long-term credentials usage
 but you did not specify the default realm option (-r option).
                Check your configuration.
0: SSL23: Certificate file found: /etc/turn_server_cert.pem
0: SSL23: Private key file found: /etc/turn_server_pkey.pem
0: TLS1.0: Certificate file found: /etc/turn_server_cert.pem
0: TLS1.0: Private key file found: /etc/turn_server_pkey.pem
0: TLS1.1: Certificate file found: /etc/turn_server_cert.pem
0: TLS1.1: Private key file found: /etc/turn_server_pkey.pem
0: TLS1.2: Certificate file found: /etc/turn_server_cert.pem
0: TLS1.2: Private key file found: /etc/turn_server_pkey.pem
0: TLS cipher suite: DEFAULT
0: DTLS: Certificate file found: /etc/turn_server_cert.pem
0: DTLS: Private key file found: /etc/turn_server_pkey.pem
0: DTLS cipher suite: DEFAULT
0: pid file created: /var/run/turnserver.pid
0: IO method (main listener thread): epoll (with changelist)
0: WARNING: I cannot support STUN CHANGE_REQUEST functionality because only one 
IP address is provided
0: Wait for relay ports initialization…
0:   relay <the ip address of my server > initialization…
0:   relay <the ip address of my server > initialization done
0: Relay ports initialization done
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=2 created
0: IO method (general relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=0 created
0: turn server id=1 created
0: IO method (general relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=4 created
0: turn server id=3 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=5 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=6 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=7 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=8 created
0: IO method (udp listener/relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=9 created
0: turn server id=128 created
0: IO method (udp listener/relay thread): epoll (with changelist)
0: turn server id=129 created
0: Total UDP servers: 2
0: Total General servers: 10
0: IO method (auth thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)
0: IO method (admin thread): epoll (with change list)

But I open the address with the port 3478 in the brower,but it can not connect 
to the server.
Thanks for your help.

Original comment by ghwil...@gmail.com on 3 Jun 2015 at 8:51

GoogleCodeExporter commented 8 years ago
remove "no-cli", add "verbose", and run the TURN server (and try the browser). 
Then post the full server output here.

Original comment by mom040...@gmail.com on 3 Jun 2015 at 4:41

GoogleCodeExporter commented 8 years ago
@mom040...@gmail.com
I remove "no-cli" and add "verbose" in the turn server.conf.

listening-port=3478
tls-listening-port=5349
listening-ip=<the ip address of my server >
relay-ip=<the ip address of my server >
external-ip=<the ip address of my server >
relay-threads=10
lt-cred-mech
user=xlsgrid:0
user=u2:1
max-bps=1024
cert=/etc/turn_server_cert.pem
pkey=/etc/turn_server_pkey.pem
mobility
verbose

This is the full server output as follow
turnserver -c /etc/turnserver.conf
0: log file opened: /var/log/turn_24015_2015-06-04.log
0:
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.4.5.1 'Ardee West'
0:
Max number of open files/sockets allowed for this process: 65536
0:
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 21500 (approximately)
0:

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 is not supported
0: TURN/STUN ALPN is not supported
0: Third-party authorization (oAuth) supported
0: GCM (AEAD) supported
0: OpenSSL compile-time version: OpenSSL 1.0.1m 19 Mar 2015
0:
0: SQLite is not supported
0: Redis is not supported
0: PostgreSQL is not supported
0: MySQL supported
0: MongoDB is not supported
0:
0: SCTP is not supported
0: Default Net Engine version: 2 (UDP thread per network endpoint)

=====================================================

0: Listener address to use: <My server's IP>
0: Relay address to use: <My server's IP>
0: 1024 bytes per second allowed per session
0: Domain name:
0: Default realm:
0:
CONFIGURATION ALERT: you did specify the long-term credentials usage
 but you did not specify the default realm option (-r option).
                Check your configuration.
0: SSL23: Certificate file found: /etc/turn_server_cert.pem
0: SSL23: Private key file found: /etc/turn_server_pkey.pem
0: TLS1.0: Certificate file found: /etc/turn_server_cert.pem
0: TLS1.0: Private key file found: /etc/turn_server_pkey.pem
0: TLS1.1: Certificate file found: /etc/turn_server_cert.pem
0: TLS1.1: Private key file found: /etc/turn_server_pkey.pem
0: TLS1.2: Certificate file found: /etc/turn_server_cert.pem
0: TLS1.2: Private key file found: /etc/turn_server_pkey.pem
0: TLS cipher suite: DEFAULT
0: DTLS: Certificate file found: /etc/turn_server_cert.pem
0: DTLS: Private key file found: /etc/turn_server_pkey.pem
0: DTLS cipher suite: DEFAULT
0: pid file created: /var/run/turnserver.pid
0: IO method (main listener thread): epoll (with changelist)
0: WARNING: I cannot support STUN CHANGE_REQUEST functionality because only one 
IP address is provided
0: Wait for relay ports initialization...
0:   relay <My server's IP> initialization...
0:   relay <My server's IP> initialization done
0: Relay ports initialization done
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=1 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=0 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=2 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=3 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=4 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=5 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=6 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=7 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=8 created
0: IO method (udp listener/relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=9 created
0: turn server id=128 created
0: IO method (udp listener/relay thread): epoll (with changelist)
0: turn server id=129 created
0: IPv4. DTLS/UDP listener opened on: <My server's IP>:3478
0: IPv4. DTLS/UDP listener opened on: <My server's IP>:5349
0: IPv4. TLS/TCP listener opened on : <My server's IP>:3478
0: IPv4. TLS/TCP listener opened on : <My server's IP>:5349
0: Total UDP servers: 2
0: Total General servers: 10
0: IO method (auth thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)
0: IO method (admin thread): epoll (with changelist)
0: IPv4. CLI listener opened on : 127.0.0.1:5766

I try to open the IP address with the port in the browser again,but it still 
can not connect to the address.
I would appreciate your help if you can give me some advice.Thank you. :D

Original comment by ghwil...@gmail.com on 3 Jun 2015 at 5:28

GoogleCodeExporter commented 8 years ago
OK, the next step will be capturing the network exchange between the browser 
and the TURN server. Use wireshark for that, and attach the captured file to 
the issue report.

Original comment by mom040...@gmail.com on 4 Jun 2015 at 1:23

GoogleCodeExporter commented 8 years ago
@mom040...@gmail.com

The attached file is what I get when I use the wireshark to capture.
My server's IP address is 101.251.225.38.  

Original comment by ghwil...@gmail.com on 4 Jun 2015 at 5:43

Attachments:

GoogleCodeExporter commented 8 years ago
I see lots of errors "destination unreachable, host administratively 
prohibited". This is your network configuration issue.

Original comment by mom040...@gmail.com on 4 Jun 2015 at 8:05

GoogleCodeExporter commented 8 years ago
@mom040...@gmail.com

I am confused about those errors.Did you meet this situation before?I have no 
clue now,could you give me some advice?Thank you.

Original comment by ghwil...@gmail.com on 4 Jun 2015 at 9:52

GoogleCodeExporter commented 8 years ago
The most probable cause is that either the system firewall settings on your 
TURN server system, or your network firewall, are not allowing that kind of 
incoming traffic to the TURN server: limitations are usually expressed in terms 
of combination of IP addresses, ports and protocols.

Original comment by mom040...@gmail.com on 4 Jun 2015 at 5:08

GoogleCodeExporter commented 8 years ago
@mom040...@gmail.com

I have fixed the firewall settings issues.I open the IP address with the port 
and get it's outputs.
This is what I get

TURN Server 
use https connection for the admin session

And then I run the test script "relay.sh" and get this result.
[root@localhost basic]# ./relay.sh
0:
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.4.5.1 'Ardee West'
0:
Max number of open files/sockets allowed for this process: 65536
0:
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 21500 (approximately)
0:

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 is not supported
0: TURN/STUN ALPN is not supported
0: Third-party authorization (oAuth) supported
0: GCM (AEAD) supported
0: OpenSSL compile-time version: OpenSSL 1.0.1m 19 Mar 2015
0:
0: SQLite is not supported
0: Redis is not supported
0: PostgreSQL is not supported
0: MySQL supported
0: MongoDB is not supported
0:
0: SCTP is not supported
0: Default Net Engine version: 2 (UDP thread per network endpoint)

=====================================================

0: Config file found: /etc/turnserver.conf
0: Listener address to use: 101.251.225.38
0: Relay address to use: 101.251.225.38
0: 1024 bytes per second allowed per session
0: Listener address to use: 127.0.0.1
0: Listener address to use: ::1
0: Relay address to use: 127.0.0.1
0: Relay address to use: ::1
0: 3000000 bytes per second allowed per session
0: WARNING: Options -b, --userdb and --db are not supported because SQLite is 
not supported in this build.
0: Config file found: /etc/turnserver.conf
0: Domain name:
0: Default realm:
0: ERROR:
CONFIG ERROR: -a and -z options cannot be used together.

I do not know how to tackle this problem.Could you give me some advice?

Original comment by ghwil...@gmail.com on 8 Jun 2015 at 9:45

GoogleCodeExporter commented 8 years ago
Install SQLite, as a starter.

Original comment by mom040...@gmail.com on 8 Jun 2015 at 2:17

GoogleCodeExporter commented 8 years ago
@mom040...@gmail.com

Thank you for the help you have given to me.I still have a question.When I 
start the coturn with the "turn server -c turn server.conf" command and open my 
server's IP address in the browser,I get the " TURN Server 
use https connection for the admin session" output in the browser.

It outputs this in the terminal.
[root@localhost ~]# turnserver -c /etc/turnserver.conf
0: log file opened: /var/log/turn_18625_2015-06-09.log
0:
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.4.5.1 'Ardee West'
0:
Max number of open files/sockets allowed for this process: 65536
0:
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 21500 (approximately)
0:

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 is not supported
0: TURN/STUN ALPN is not supported
0: Third-party authorization (oAuth) supported
0: GCM (AEAD) supported
0: OpenSSL compile-time version: OpenSSL 1.0.1m 19 Mar 2015
0:
0: SQLite is not supported
0: Redis is not supported
0: PostgreSQL is not supported
0: MySQL supported
0: MongoDB is not supported
0:
0: SCTP is not supported
0: Default Net Engine version: 2 (UDP thread per network endpoint)

=====================================================

0: Listener address to use: 101.251.225.**
0: Relay address to use: 101.251.225.**
0: 1024 bytes per second allowed per session
0: Domain name:
0: Default realm:
0:
CONFIGURATION ALERT: you did specify the long-term credentials usage
 but you did not specify the default realm option (-r option).
                Check your configuration.
0: SSL23: Certificate file found: /etc/turn_server_cert.pem
0: SSL23: Private key file found: /etc/turn_server_pkey.pem
0: TLS1.0: Certificate file found: /etc/turn_server_cert.pem
0: TLS1.0: Private key file found: /etc/turn_server_pkey.pem
0: TLS1.1: Certificate file found: /etc/turn_server_cert.pem
0: TLS1.1: Private key file found: /etc/turn_server_pkey.pem
0: TLS1.2: Certificate file found: /etc/turn_server_cert.pem
0: TLS1.2: Private key file found: /etc/turn_server_pkey.pem
0: TLS cipher suite: DEFAULT
0: DTLS: Certificate file found: /etc/turn_server_cert.pem
0: DTLS: Private key file found: /etc/turn_server_pkey.pem
0: DTLS cipher suite: DEFAULT
0: pid file created: /var/run/turnserver.pid
0: IO method (main listener thread): epoll (with changelist)
0: WARNING: I cannot support STUN CHANGE_REQUEST functionality because only one 
IP address is provided
0: Wait for relay ports initialization...
0:   relay 101.251.225.38 initialization...
0:   relay 101.251.225.38 initialization done
0: Relay ports initialization done
0: IO method (general relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=1 created
0: turn server id=0 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=2 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=3 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=4 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=5 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=6 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=7 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=8 created
0: IO method (udp listener/relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=9 created
0: turn server id=128 created
0: IO method (udp listener/relay thread): epoll (with changelist)
0: turn server id=129 created
0: IPv4. DTLS/UDP listener opened on: 101.251.225.**:3478
0: IPv4. DTLS/UDP listener opened on: 101.251.225.**:5349
0: IPv4. TLS/TCP listener opened on : 101.251.225.**:3478
0: IPv4. TLS/TCP listener opened on : 101.251.225.**:5349
0: Total UDP servers: 2
0: Total General servers: 10
0: IO method (auth thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)
0: IO method (admin thread): epoll (with changelist)
0: IPv4. CLI listener opened on : 127.0.0.1:5766
51: IPv4. tcp or tls connected to: 101.81.102.99:31405
51: IPv4. tcp or tls connected to: 101.81.102.99:31404
51: read_client_connection: HTTP request: GET / HTTP/1.1
Host: 101.251.225.**:3478
Connection: keep-alive
Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8
RA-Ver: 2.10.4
RA-Sid: 65516663-20150605-074853-9eaf51-bea4b9

51: session 007000000000000001: TCP socket closed remotely 101.81.102.99:31404
51: session 007000000000000001: closed (2nd stage), user <> realm <> origin <>, 
local 101.251.225.38:3478, remote 101.81.102.99:31404, reason: TCP connection 
closed by client (callback)
53: read_client_connection: HTTP request: GET /favicon.ico HTTP/1.1
Host: 101.251.225.38:3478
Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36
Accept: */*
Referer: http://101.251.225.**:3478/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8
RA-Ver: 2.10.4
RA-Sid: 65516663-20150605-074853-9eaf51-bea4b9

53: session 002000000000000001: TCP socket closed remotely 101.81.102.99:31405
53: session 002000000000000001: closed (2nd stage), user <> realm <> origin <>, 
local 101.251.225.**:3478, remote 101.81.102.99:31405, reason: TCP connection 
closed by client (callback)
87: IPv4. tcp or tls connected to: 101.81.102.99:31582
97: session 001000000000000001: TCP socket closed remotely 101.81.102.99:31582
97: session 001000000000000001: closed (2nd stage), user <> realm <> origin <>, 
local 101.251.225.38:3478, remote 101.81.102.99:31582, reason: TCP connection 
closed by client (callback)

This is my turn server.conf.
listening-port=3478
tls-listening-port=5349
listening-ip=<the ip address of my server >
relay-ip=<the ip address of my server >
external-ip=<the ip address of my server >
relay-threads=10
lt-cred-mech
user=u1:0
user=u2:1
max-bps=1024
cert=/etc/turn_server_cert.pem
pkey=/etc/turn_server_pkey.pem
mobility
verbose

But when I try to use the coturn with the code 
" var iceServer =
{"iceServers":[
{"url": "stun:101.251.225.**:3478"},
{"url":"turn:u1@101.251.225.**:3478",credential:"0"}
]
};" in my webrtc project,the running coturn outputs nothing in the terminal.
I do not know whether the coturn correctly runs and works.
I would appreciate your help if you can give me some advice.Thanks again.Have a 
good day.

Original comment by ghwil...@gmail.com on 9 Jun 2015 at 6:06

GoogleCodeExporter commented 8 years ago
All these questions are answered in the wiki docs. Just try to read it.

1) You have to use HTTPS to connect to the admin web connection.
2) You have to configure the realm.
3) You will know if coturn works correctly if you try to use it as intended and 
it will work fine. Then you will know.

Original comment by mom040...@gmail.com on 9 Jun 2015 at 6:10

GoogleCodeExporter commented 8 years ago
@mom040...@gmail.com

Thanks for your help.I readed the wiki docs and tried to fix these issues.
I have added the realm to the turn server.conf.This is the new server.conf as 
follows:
listening-port=3478
tls-listening-port=5349
listening-ip=<the ip address of my server >
relay-ip=<the ip address of my server >
external-ip=<the ip address of my server >
relay-threads=10
lt-cred-mech
user=u1:0
user=u2:0
max-bps=1024
cert=/etc/turn_server_cert.pem
pkey=/etc/turn_server_pkey.pem
mobility
verbose
realm=www.xlsgrid.net

In my javascript code,reference the turn server as follows:
var pc_config = {"iceServers": [{"url": "stun:stun.l.google.com:19302"},
                        {"url":"turn:u1@101.251.225.38", 
                                          "credential":"0"}]};
        pc_new = new webkitRTCPeerConnection(pc_config);

I start the server like this:
turnserver -L 101.251.225.38 -a -f -r www.xlsgrid.net

I run the client application.Users aren't using the same wireless LAN.
In the turn server log I see this:

[root@localhost ~]# turnserver -L 101.251.225.38 -a -f -r www.xlsgrid.net
0: log file opened: /var/log/turn_14747_2015-06-11.log
0:
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.4.5.1 'Ardee West'
0:
Max number of open files/sockets allowed for this process: 65536
0:
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 21500 (approximately)
0:

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 is not supported
0: TURN/STUN ALPN is not supported
0: Third-party authorization (oAuth) supported
0: GCM (AEAD) supported
0: OpenSSL compile-time version: OpenSSL 1.0.1m 19 Mar 2015
0:
0: SQLite is not supported
0: Redis is not supported
0: PostgreSQL is not supported
0: MySQL supported
0: MongoDB is not supported
0:
0: SCTP is not supported
0: Default Net Engine version: 2 (UDP thread per network endpoint)

=====================================================

0: Config file found: /root/../etc/turnserver.conf
0: Listener address to use: 101.251.225.38
0: Relay address to use: 101.251.225.38
0: 1024 bytes per second allowed per session
0: Config file found: /root/../etc/turnserver.conf
0: Domain name:
0: Default realm: www.xlsgrid.net
0: SSL23: Certificate file found: /usr/local/etc/turn_server_cert.pem
0: SSL23: Private key file found: /usr/local/etc/turn_server_pkey.pem
0: TLS1.0: Certificate file found: /usr/local/etc/turn_server_cert.pem
0: TLS1.0: Private key file found: /usr/local/etc/turn_server_pkey.pem
0: TLS1.1: Certificate file found: /usr/local/etc/turn_server_cert.pem
0: TLS1.1: Private key file found: /usr/local/etc/turn_server_pkey.pem
0: TLS1.2: Certificate file found: /usr/local/etc/turn_server_cert.pem
0: TLS1.2: Private key file found: /usr/local/etc/turn_server_pkey.pem
0: TLS cipher suite: DEFAULT
0: DTLS: Certificate file found: /usr/local/etc/turn_server_cert.pem
0: DTLS: Private key file found: /usr/local/etc/turn_server_pkey.pem
0: DTLS cipher suite: DEFAULT
0: pid file created: /var/run/turnserver.pid
0: IO method (main listener thread): epoll (with changelist)
0: WARNING: I cannot support STUN CHANGE_REQUEST functionality because only one 
IP address is provided
0: Wait for relay ports initialization...
0:   relay 101.251.225.38 initialization...
0:   relay 101.251.225.38 initialization done
0: Relay ports initialization done
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=1 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=0 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=2 created
0: IO method (general relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=3 created
0: turn server id=4 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=5 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=6 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=7 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=8 created
0: IO method (udp listener/relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=9 created
0: turn server id=128 created
0: IO method (udp listener/relay thread): epoll (with changelist)
0: turn server id=129 created
0: IPv4. DTLS/UDP listener opened on: 101.251.225.38:3478
0: IPv4. DTLS/UDP listener opened on: 101.251.225.38:5349
0: IPv4. TLS/TCP listener opened on : 101.251.225.38:3478
0: IPv4. TLS/TCP listener opened on : 101.251.225.38:5349
0: Total UDP servers: 2
0: Total General servers: 10
0: IO method (auth thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)
0: IO method (admin thread): epoll (with changelist)
0: IPv4. CLI listener opened on : 127.0.0.1:5766
19: handle_udp_packet: New UDP endpoint: local addr 101.251.225.38:3478, remote 
addr 101.81.102.99:28831
19: session 128000000000000001: realm <www.xlsgrid.net> user <>: incoming 
packet BINDING processed, success
19: handle_udp_packet: New UDP endpoint: local addr 101.251.225.38:3478, remote 
addr 101.81.102.99:28832
19: session 128000000000000002: realm <www.xlsgrid.net> user <>: incoming 
packet BINDING processed, success
19: handle_udp_packet: New UDP endpoint: local addr 101.251.225.38:3478, remote 
addr 101.81.102.99:28833
19: session 128000000000000003: realm <www.xlsgrid.net> user <>: incoming 
packet BINDING processed, success
19: handle_udp_packet: New UDP endpoint: local addr 101.251.225.38:3478, remote 
addr 101.81.102.99:28834
19: session 128000000000000004: realm <www.xlsgrid.net> user <>: incoming 
packet BINDING processed, success
19: session 128000000000000001: realm <www.xlsgrid.net> user <>: incoming 
packet message processed, error 401: Unknown error
19: session 128000000000000004: realm <www.xlsgrid.net> user <>: incoming 
packet message processed, error 401: Unknown error
19: session 128000000000000002: realm <www.xlsgrid.net> user <>: incoming 
packet message processed, error 401: Unknown error
19: session 128000000000000003: realm <www.xlsgrid.net> user <>: incoming 
packet message processed, error 401: Unknown error
19: IPv4. Local relay addr: 101.251.225.38:52329
19: session 128000000000000001: new, realm=<www.xlsgrid.net>, username=<u1>, 
lifetime=600
19: session 128000000000000001: realm <www.xlsgrid.net> user <u1>: incoming 
packet ALLOCATE processed, success
19: IPv4. Local relay addr: 101.251.225.38:60236
19: session 128000000000000004: new, realm=<www.xlsgrid.net>, username=<u1>, 
lifetime=600
19: session 128000000000000004: realm <www.xlsgrid.net> user <u1>: incoming 
packet ALLOCATE processed, success
19: IPv4. Local relay addr: 101.251.225.38:53276
19: session 128000000000000003: new, realm=<www.xlsgrid.net>, username=<u1>, 
lifetime=600
19: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet ALLOCATE processed, success
19: IPv4. Local relay addr: 101.251.225.38:63402
19: session 128000000000000002: new, realm=<www.xlsgrid.net>, username=<u1>, 
lifetime=600
19: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet ALLOCATE processed, success
22: handle_udp_packet: New UDP endpoint: local addr 101.251.225.38:3478, remote 
addr 101.81.102.99:28848
22: session 128000000000000005: realm <www.xlsgrid.net> user <>: incoming 
packet BINDING processed, success
22: session 128000000000000005: realm <www.xlsgrid.net> user <>: incoming 
packet message processed, error 401: Unknown error
23: IPv4. Local relay addr: 101.251.225.38:61066
23: session 128000000000000005: new, realm=<www.xlsgrid.net>, username=<u1>, 
lifetime=600
23: session 128000000000000005: realm <www.xlsgrid.net> user <u1>: incoming 
packet ALLOCATE processed, success
23: session 128000000000000005: peer 10.33.76.218 lifetime updated: 300
23: session 128000000000000005: realm <www.xlsgrid.net> user <u1>: incoming 
packet CREATE_PERMISSION processed, success
23: session 128000000000000005: peer 10.33.76.218 lifetime updated: 300
23: session 128000000000000005: realm <www.xlsgrid.net> user <u1>: incoming 
packet CREATE_PERMISSION processed, success
29: session 128000000000000001: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
29: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
29: session 128000000000000004: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
29: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
32: session 128000000000000005: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
39: session 128000000000000001: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
39: session 128000000000000004: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
39: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
39: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
43: session 128000000000000005: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
49: session 128000000000000001: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
49: session 128000000000000004: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
49: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
49: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
49: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
49: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
49: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
49: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
53: session 128000000000000005: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
59: session 128000000000000001: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
59: session 128000000000000004: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
59: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
59: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
63: session 128000000000000005: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
63: session 128000000000000005: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
68: session 128000000000000005: refreshed, realm=<www.xlsgrid.net>, 
username=<u1>, lifetime=0
68: session 128000000000000005: realm <www.xlsgrid.net> user <u1>: incoming 
packet REFRESH processed, success
69: session 128000000000000005: closed (2nd stage), user <u1> realm 
<www.xlsgrid.net> origin <>, local 101.251.225.38:3478, remote 
101.81.102.99:28848, reason: allocation timeout
69: session 128000000000000005: delete: realm=<www.xlsgrid.net>, username=<u1>
69: session 128000000000000005: peer 10.33.76.218 deleted
69: session 128000000000000004: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
69: session 128000000000000001: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
69: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
70: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
70: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
70: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
79: session 128000000000000001: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
79: session 128000000000000004: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
80: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
80: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet BINDING processed, success
89: session 128000000000000003: refreshed, realm=<www.xlsgrid.net>, 
username=<u1>, lifetime=0
89: session 128000000000000003: realm <www.xlsgrid.net> user <u1>: incoming 
packet REFRESH processed, success
89: session 128000000000000004: refreshed, realm=<www.xlsgrid.net>, 
username=<u1>, lifetime=0
89: session 128000000000000004: realm <www.xlsgrid.net> user <u1>: incoming 
packet REFRESH processed, success
89: session 128000000000000001: refreshed, realm=<www.xlsgrid.net>, 
username=<u1>, lifetime=0
89: session 128000000000000001: realm <www.xlsgrid.net> user <u1>: incoming 
packet REFRESH processed, success
89: session 128000000000000002: refreshed, realm=<www.xlsgrid.net>, 
username=<u1>, lifetime=0
89: session 128000000000000002: realm <www.xlsgrid.net> user <u1>: incoming 
packet REFRESH processed, success
90: session 128000000000000003: closed (2nd stage), user <u1> realm 
<www.xlsgrid.net> origin <>, local 101.251.225.38:3478, remote 
101.81.102.99:28833, reason: allocation timeout
90: session 128000000000000003: delete: realm=<www.xlsgrid.net>, username=<u1>
90: session 128000000000000002: closed (2nd stage), user <u1> realm 
<www.xlsgrid.net> origin <>, local 101.251.225.38:3478, remote 
101.81.102.99:28832, reason: allocation timeout
90: session 128000000000000002: delete: realm=<www.xlsgrid.net>, username=<u1>
90: session 128000000000000004: closed (2nd stage), user <u1> realm 
<www.xlsgrid.net> origin <>, local 101.251.225.38:3478, remote 
101.81.102.99:28834, reason: allocation timeout
90: session 128000000000000004: delete: realm=<www.xlsgrid.net>, username=<u1>
90: session 128000000000000001: closed (2nd stage), user <u1> realm 
<www.xlsgrid.net> origin <>, local 101.251.225.38:3478, remote 
101.81.102.99:28831, reason: allocation timeout
90: session 128000000000000001: delete: realm=<www.xlsgrid.net>, username=<u1>

Does it mean the turn server  works?but I can not see the video screen in my 
webrtc application.
BTW,I add the admin user to the the "admin_user" table in my db file and start 
the server with the --db="/var/db/my db file's name"  ,but I do know how can 
the turn server  find the "admin_user" table in my db file.

Thanks again.Have a good day.:D

Original comment by ghwil...@gmail.com on 11 Jun 2015 at 6:20