1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Support SRS Stack token for authentication. v6.0.74 (#3794)

When accessing the SRS Stack, you should log in and use a token for each
request, or utilize the HTTP API with a secret Bearer token included in
every request. The SRS Stack HTTP API proxies both /api/v1 and /rtc/v1
to the SRS HTTP API while ensuring secure authentication. Additionally,
there is a console in the SRS Stack that requires the same token to
request the SRS Stack HTTP API, which is then proxied to the SRS HTTP
API.

The SRS Stack runs SRS with the HTTP API listening at 127.0.0.1:1985 on
the local loopback interface, allowing only the SRS Stack to access it
without authentication. All other users must login and access the SRS
Stack through its interface, rather than directly accessing the SRS HTTP
API within the SRS Stack.

---------

Co-authored-by: panda <542638787@qq.com>
This commit is contained in:
Winlin 2023-09-08 08:22:45 +08:00 committed by GitHub
parent 26b3154724
commit 6f42ca67cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 26 additions and 20 deletions

View file

@ -2502,6 +2502,7 @@ srs_error_t SrsRtcAudioRecvTrack::on_rtp(SrsRtcSource* source, SrsRtpPacket* pkt
srs_error_t err = srs_success;
pkt->set_avsync_time(cal_avsync_time(pkt->header.get_timestamp()));
srs_info("Audio async rate=%d, rtp=%u, corrected=%" PRId64, (int)rate_, pkt->header.get_timestamp(), pkt->get_avsync_time());
if ((err = source->on_rtp(pkt)) != srs_success) {
return srs_error_wrap(err, "source on rtp");
@ -2560,6 +2561,7 @@ srs_error_t SrsRtcVideoRecvTrack::on_rtp(SrsRtcSource* source, SrsRtpPacket* pkt
srs_error_t err = srs_success;
pkt->set_avsync_time(cal_avsync_time(pkt->header.get_timestamp()));
srs_info("Video async rate=%d, rtp=%u, corrected=%" PRId64, (int)rate_, pkt->header.get_timestamp(), pkt->get_avsync_time());
if ((err = source->on_rtp(pkt)) != srs_success) {
return srs_error_wrap(err, "source on rtp");