Open ChowDPa02k opened 1 year ago
We need to refine the endpoint discovering for listening. This technique means allow user listening at IPv4, IPv6, IPv4+IPv6 endpoints. But there are some bugs about this feature. Any patch is welcome.
https://github.com/ossrs/srs/blob/427104f1dab86f5afc7d7b49b02ed27d03ef9346/trunk/src/app/srs_app_server.cpp#L333-L338
rtmp already supported listen multi endpoints, use SrsMultipleTcpListeners
to replace the SrsTcpListener
will resolve this issue I guess.
Look the differences between SrsMultipleTcpListeners
and SrsTcpListener
:
https://github.com/ossrs/srs/blob/427104f1dab86f5afc7d7b49b02ed27d03ef9346/trunk/src/app/srs_app_server.cpp#L574-L590
The SrsConfig::get_http_api_listen
& string SrsConfig::get_http_stream_listen()
also need to refactor to return a vec
rather the first arg.
https://github.com/ossrs/srs/blob/427104f1dab86f5afc7d7b49b02ed27d03ef9346/trunk/src/app/srs_app_config.cpp#L7641-L7659
@suzp1984 Yep, you are correct. With the multiple listener using a vector of ports, we can fix this issue, while also considering the bellow issues:
We need to support a comprehensive solution about listening. Welcome to file a pullrequest about this feature, at where we can discuss the details.
Description
Please description your issue here
SRS Version: 6.0.59(Bee) Windows Build
SRS Log:
Replay
Please describe how to replay the bug?
Step 1: Change http_server listen port to the following:
Use network analytics tool, to see SRS listen IPV6 only:
And cannot access srs player or srs console via 127.0.0.1:8080, but from IPV6 can do.
Step 2: Change http_server listen port to the following:
Use network analytics tool, to see SRS listen IPV4 only:
And cannot play http-flv by using address like
http://[ipv6:add:ress::]:8080/live/livestream.flv
, but from IPV4 can do.Step 3: Change http_server listen port to the following:
Use network analytics tool, to see SRS listen IPV6 only:
Expect
We have a demand that getting HTTP-FLV stream from both tcp46, sometimes accessing via IP address only.
To be clear, primary connect from NAT traverse solution like Zerotier, but sometimes it will fail, then we connect SRS using alternative IPV6 Address directly. With the IPV6-only connection, HTTP-server listening at tcp4 won't work.
Throughout our tests, flv.js is the closest approach to real-time playback (except webrtc). When HTTP-server failed to directly connect ipv6 address, we have to use 3rd party player (e.g. VLC) to play RTMP, which will always 0.5s slower than flv.js.