-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Config http_api and rtc_server.tcp listen on same port. #4026
Comments
APIs and WebRTC are capable of functioning together, and the type of protocol can be determined based on the content of the body. If they do not work well together, it is actually due to issues with the software implementation rather than the protocols being unable to recognize each other. Since the Listener is a mechanism that is continuously patched, it is not considered reasonable. A better approach would be to completely redesign the mechanism of the Listener. It is important to note that the SRT's listener requires special handling. For reference, see the issue at #3251 (comment). This issue necessitates improvements to the current structure.
|
Let APIs and WebRTC works on same endpoints would be easy, just refer the I like the One more thing to consider, the srs/trunk/src/app/srs_app_listener.cpp Lines 256 to 261 in 427104f
srs/trunk/src/kernel/srs_kernel_utility.cpp Lines 239 to 257 in 427104f
srs/trunk/src/app/srs_app_config.hpp Lines 415 to 418 in 427104f
srs/trunk/src/app/srs_app_config.hpp Lines 1028 to 1029 in 427104f
For the RTMP, http_api, http_server, the But for the rest of the listens, which means just port number (or just ipv4 loop back address + port number).
Here is how gb28181 config its listener, I think it lost its flexibility. srs/trunk/src/app/srs_app_gb28181.cpp Lines 417 to 439 in 427104f
Because |
Describe the bug
I notice
http_api
&http_server
can listen on same endpoint, andrtc_server.tcp
&http_server
can also listen on same endpoint.srs/trunk/src/app/srs_app_server.cpp
Lines 351 to 352 in 427104f
But there are a lot of
SrsTcpListener
s there, can they shared with same endpoints just likereuse_api_over_server_
&reuse_rtc_over_server_
?e.g. can we reuse rtc over http_api?
change
conf/rtc.tcp.only.conf
, lethttp_api.listen
andrtc_server.tcp.listen
with same port.then boot the srs:
./objs/srs -c conf/rtc.tcp.only.conf
I don't think the http_api and webRTC over TCP can still works well in this case.
Version
ALL SRS version
To Reproduce
Steps to reproduce the behavior:
not just
rtc_server.tcp.listen
conflict withhttp_api.listen
,rtmp
can also be configed conflict withhttp_server.listen
.e.g.
http_server.listen
to 1935;./objs/srs -c conf/http.hls.conf
;http://127.0.0.1:1935
, the RTMP listener will hijack the connection. the web browser can't get response.Expected behavior
Disallow tcp
listen
have same value, except the already supportedreuse_api_over_server_
andreuse_rtc_over_server_
.Or support more tcp listener reuse cases, e.g. rtc & http_api, and disallow others conflicts.
Solutions
support reuse TcpListeners, but there are a lot of them:
srs/trunk/src/app/srs_app_server.cpp
Lines 332 to 341 in 427104f
We can do more things, by do support more reuse
listen
cases, and do moreSrsConfig::check_config
, then send panic earlier.The text was updated successfully, but these errors were encountered: