mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
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>
45 lines
1.5 KiB
Go
45 lines
1.5 KiB
Go
// The MIT License (MIT)
|
|
//
|
|
// Copyright (c) 2022 Winlin
|
|
//
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
// this software and associated documentation files (the "Software"), to deal in
|
|
// the Software without restriction, including without limitation the rights to
|
|
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
// the Software, and to permit persons to whom the Software is furnished to do so,
|
|
// subject to the following conditions:
|
|
//
|
|
// The above copyright notice and this permission notice shall be included in all
|
|
// copies or substantial portions of the Software.
|
|
//
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
package gb28181
|
|
|
|
import (
|
|
"github.com/ossrs/go-oryx-lib/logger"
|
|
"io/ioutil"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
if err := prepareTest(); err != nil {
|
|
logger.Ef(nil, "Prepare test fail, err %+v", err)
|
|
os.Exit(-1)
|
|
}
|
|
|
|
// Disable the logger during all tests.
|
|
if *srsLog == false {
|
|
olw := logger.Switch(ioutil.Discard)
|
|
defer func() {
|
|
logger.Switch(olw)
|
|
}()
|
|
}
|
|
|
|
os.Exit(m.Run())
|
|
}
|