Closed computersalat closed 7 months ago
@computersalat feel free to submit a PR
@eakraly
sorry I was mistaken. When you want to make coturn listen on IPv4 as well as on IPv6 you need:
listening-ip= or listening-ip=0.0.0.0
listening-ip=::
then you get:
0: (9364): INFO: Wait for relay ports initialization...
0: (9364): INFO: relay 0.0.0.0 initialization...
0: (9364): INFO: relay 0.0.0.0 initialization done
0: (9364): INFO: relay :: initialization...
0: (9364): INFO: relay :: initialization done
0: (9364): INFO: Relay ports initialization done
0: (9364): INFO: Total General servers: 2
6: (9365): DEBUG: turn server id=0 created
6: (9365): INFO: IPv4. TLS/TCP listener opened on : 0.0.0.0:3478
6: (9365): INFO: IPv4. TLS/TCP listener opened on : 0.0.0.0:5349
6: (9365): INFO: IPv6. TLS/TCP listener opened on : :::3478
6: (9365): INFO: IPv6. TLS/TCP listener opened on : :::5349
6: (9366): DEBUG: turn server id=1 created
6: (9366): INFO: IPv4. TLS/TCP listener opened on : 0.0.0.0:3478
6: (9366): INFO: IPv4. TLS/TCP listener opened on : 0.0.0.0:5349
6: (9366): INFO: IPv6. TLS/TCP listener opened on : :::3478
6: (9366): INFO: IPv6. TLS/TCP listener opened on : :::5349
6: (9364): INFO: IPv4. DTLS/UDP listener opened on: 0.0.0.0:3478
6: (9364): INFO: IPv4. DTLS/UDP listener opened on: 0.0.0.0:5349
6: (9364): INFO: IPv6. DTLS/UDP listener opened on: :::3478
6: (9364): INFO: IPv6. DTLS/UDP listener opened on: :::5349
with
listening-ip=
I get:
0: (9941): INFO: Wait for relay ports initialization...
0: (9941): INFO: relay 0.0.0.0 initialization...
0: (9941): INFO: relay 0.0.0.0 initialization done
0: (9941): INFO: Relay ports initialization done
0: (9941): INFO: Total General servers: 2
3: (9942): DEBUG: turn server id=0 created
3: (9942): INFO: IPv4. TLS/TCP listener opened on : 0.0.0.0:3478
3: (9942): INFO: IPv4. TLS/TCP listener opened on : 0.0.0.0:5349
3: (9943): DEBUG: turn server id=1 created
3: (9943): INFO: IPv4. TLS/TCP listener opened on : 0.0.0.0:3478
3: (9941): INFO: IPv4. DTLS/UDP listener opened on: 0.0.0.0:3478
3: (9943): INFO: IPv4. TLS/TCP listener opened on : 0.0.0.0:5349
3: (9941): INFO: IPv4. DTLS/UDP listener opened on: 0.0.0.0:5349
hence only listening on IPv4
with
listening-ip=::
I get:
0: (9990): INFO: Wait for relay ports initialization...
0: (9990): INFO: relay :: initialization...
0: (9990): INFO: relay :: initialization done
0: (9990): INFO: Relay ports initialization done
0: (9990): INFO: Total General servers: 2
3: (9993): DEBUG: turn server id=0 created
3: (9993): INFO: IPv6. TLS/TCP listener opened on : :::3478
3: (9993): INFO: IPv6. TLS/TCP listener opened on : :::5349
3: (9994): DEBUG: turn server id=1 created
3: (9994): INFO: IPv6. TLS/TCP listener opened on : :::3478
3: (9994): INFO: IPv6. TLS/TCP listener opened on : :::5349
3: (9990): INFO: IPv6. DTLS/UDP listener opened on: :::3478
3: (9990): INFO: IPv6. DTLS/UDP listener opened on: :::5349
hence only listening on IPv6
@eakraly here it is: #1336
Hi @computersalat
I appreciate your fix but I think what needs to be done is a fix to make sure that the behavior is consistent.
It is taking the solution into direction that is wrong - documenting the wrong behavior rather than fixing it.
If documenting then we may want to clarify that unless specific IPs are provided then this option must be omitted (--listening-ip=
is not the same as not having it at all)
But why not fix it properly? I expect that 3 following options will result in the same behavior:
--listening-ip=
as command line argumentlistening-ip=
in turnsever.confAnd the result in all 3 is that turnserver is listening on all available interfaces
What happens today is that options 1,2 IMHO work incorrectly - when value is not provided the string is '\0' which is interpreted as 0.0.0.0 which results in listening on IPv4 only.
I think https://github.com/coturn/coturn/blob/294f897ccd436618be35ade634cf1c15f4bb9e48/src/client/ns_turn_ioaddr.c#L216 is the issue - if string length is 0 then the result is 0.0.0.0 which forces IPv4
@eakraly
I fully agree to fix the main cause. But I am not able to fix it as I don't know C or C++. Ich just wanted to bring awareness about the problem and how it is possible to work around until it gets a fix. Anyone else with C/C++ knowledge should kindly step in and provide a fix. Thank you Chris
Hi
in config there is the following comment:
hence I tried
with the result, that coturn is only listening on IPv4 addresses
if you want to make it listen on IPv4 as well as on IPv6 you need:
You should either update your documentation/comment to point this out or fix your code that empty IP
will result in listening on any IPv4 and IPv6 address