IPv4 & IPv6 at same time

Hi!

I followed the steps in your documentation to enable ipv6 and ipv4 on my server.

flashphoner.properties:
ip_v6=[MY_IPV6]
ice_add_ipv6_candidate=true

wcs-core.properties
-Djava.net.preferIPv4Stack=false

Now, the server only responds to IPv6:
tcp6 0 0 :::8444 :::* LISTEN 3604675/java

If I change -Djava.net.preferIPv4Stack to true, it only listens on IPv4.
tcp 0 0 0.0.0.0:8444 0.0.0.0:* LISTEN 3610702/java

I want to use both IPv4 and IPv6 at the same time.

Flashphoner version installed: 5.2.2136

On the server (Ubuntu 24.04.1 LTS), both IPv6 and IPv4 are enabled.
Both IPv4 and IPv6 connectivity seem to work fine:
ping6 google.com
PING google.com (2a00:1450:4001:829::200e) 56 data bytes
64 bytes from fra24s06-in-x0e.1e100.net (2a00:1450:4001:829::200e): icmp_seq=1 ttl=58 time=6.05 ms

ping4 google.com
PING google.com (142.250.186.110) 56(84) bytes of data.
64 bytes from fra24s06-in-f14.1e100.net (142.250.186.110): icmp_seq=1 ttl=118 time=5.99 ms

What am I doing wrong?

Thank you!
 
Last edited:

Max

Administrator
Staff member
Hello

According to the docs
The following settings can be used to set comma separated IPv4 and IPv6 interfaces to bind

Code:
https.address=0.0.0.0,2a00:1450:4001:829::200e
for port 8444

Code:
wss.address=0.0.0.0,2a00:1450:4001:829::200e
for port 8443
 
Hi again!

I'm sorry, this hasn't worked.
I set the following in flashphoner.properties:

http.address = 0.0.0.0,[::]
https.address = 0.0.0.0,[::]
wss.address = 0.0.0.0,[::]
ws.address = 0.0.0.0,[::]

(I also tried setting the public IPv4 and IPv6 addresses, but without success).

If I restart, it keeps listening only on IPv4.

If I change -Djava.net.preferIPv4Stack to false, it only responds on IPv6. If I set it to true, it only responds on IPv4.
But it's impossible for me to make it respond on both IPv4 and IPv6 at the same time.

Thanks.
 

Max

Administrator
Staff member
We tested the build 5.2.2178.
flashphoner.properties (both ip and ip_v6 are local addresses):
1739144742097.png

wcs-core.properties
1739145310905.png

When WCS is started, it shows tcp6 only in netstat results:
1739144916123.png

But actually it responds on IPv4 too:
1739145084700.png

Have you tried to open the statistics page (or web admin page) using IPv4?
 
After numerous tests, I haven't been able to make it work correctly with both IPv4 and IPv6, but I've reached some conclusions.

If I set `-Djava.net.preferIPv4Stack=` to `false`, then:
- I can reach the server via IPv4 and IPv6 using `wscat`.
- Both ports 8081 and 8444 work on IPv4 and IPv6, and they are accessible via the web.
- Port 443 (which I changed to 8443) works, allowing `wss` connections on both IPv4 and IPv6.
- However, "createstream" stops working and never reaches `STREAM_STATUS.PUBLISHING`; it remains indefinitely in "waiting."

On the other hand, if I set `-Djava.net.preferIPv4Stack=` back to `true`, then:
- EVERYTHING works (web, wss, createstream, wscat...), but only over IPv4

Any changes in flashphoner.properties or wcs-core.properties do not solve this issue. The only thing that makes a difference is changing -Djava.net.preferIPv4Stack= from true to false:
  • When set to true, everything works, but only over IPv4.
  • When set to false, everything works over both IPv4 and IPv6 except createstream, which always remains stuck in "waiting."
I still don't understand what's going on. I've been searching along with ChatGPT for a solution, but I haven't been able to fix it.

Maybe a problem with ports 30001 to 36000? (I use webrtc only)

Thank you.
 
Last edited:
Top