|
|
|
@ -22,14 +22,14 @@ func TestRTSPServer(t *testing.T) {
@@ -22,14 +22,14 @@ func TestRTSPServer(t *testing.T) {
|
|
|
|
|
switch auth { |
|
|
|
|
case "none": |
|
|
|
|
conf = "paths:\n" + |
|
|
|
|
" all:\n" |
|
|
|
|
" all_others:\n" |
|
|
|
|
|
|
|
|
|
case "internal": |
|
|
|
|
conf = "rtmp: no\n" + |
|
|
|
|
"hls: no\n" + |
|
|
|
|
"webrtc: no\n" + |
|
|
|
|
"paths:\n" + |
|
|
|
|
" all:\n" + |
|
|
|
|
" all_others:\n" + |
|
|
|
|
" publishUser: testpublisher\n" + |
|
|
|
|
" publishPass: testpass\n" + |
|
|
|
|
" publishIPs: [127.0.0.0/16]\n" + |
|
|
|
@ -40,7 +40,7 @@ func TestRTSPServer(t *testing.T) {
@@ -40,7 +40,7 @@ func TestRTSPServer(t *testing.T) {
|
|
|
|
|
case "external": |
|
|
|
|
conf = "externalAuthenticationURL: http://localhost:9120/auth\n" + |
|
|
|
|
"paths:\n" + |
|
|
|
|
" all:\n" |
|
|
|
|
" all_others:\n" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
p, ok := newInstance(conf) |
|
|
|
@ -95,7 +95,7 @@ func TestRTSPServerAuthHashed(t *testing.T) {
@@ -95,7 +95,7 @@ func TestRTSPServerAuthHashed(t *testing.T) {
|
|
|
|
|
"hls: no\n" + |
|
|
|
|
"webrtc: no\n" + |
|
|
|
|
"paths:\n" + |
|
|
|
|
" all:\n" + |
|
|
|
|
" all_others:\n" + |
|
|
|
|
" publishUser: sha256:rl3rgi4NcZkpAEcacZnQ2VuOfJ0FxAqCRaKB/SwdZoQ=\n" + |
|
|
|
|
" publishPass: sha256:E9JJ8stBJ7QM+nV4ZoUCeHk/gU3tPFh/5YieiJp6n2w=\n") |
|
|
|
|
require.Equal(t, true, ok) |
|
|
|
@ -139,7 +139,7 @@ func TestRTSPServerAuthFail(t *testing.T) {
@@ -139,7 +139,7 @@ func TestRTSPServerAuthFail(t *testing.T) {
|
|
|
|
|
"hls: no\n" + |
|
|
|
|
"webrtc: no\n" + |
|
|
|
|
"paths:\n" + |
|
|
|
|
" all:\n" + |
|
|
|
|
" all_others:\n" + |
|
|
|
|
" publishUser: testuser\n" + |
|
|
|
|
" publishPass: testpass\n") |
|
|
|
|
require.Equal(t, true, ok) |
|
|
|
@ -183,7 +183,7 @@ func TestRTSPServerAuthFail(t *testing.T) {
@@ -183,7 +183,7 @@ func TestRTSPServerAuthFail(t *testing.T) {
|
|
|
|
|
"hls: no\n" + |
|
|
|
|
"webrtc: no\n" + |
|
|
|
|
"paths:\n" + |
|
|
|
|
" all:\n" + |
|
|
|
|
" all_others:\n" + |
|
|
|
|
" readUser: testuser\n" + |
|
|
|
|
" readPass: testpass\n") |
|
|
|
|
require.Equal(t, true, ok) |
|
|
|
@ -208,7 +208,7 @@ func TestRTSPServerAuthFail(t *testing.T) {
@@ -208,7 +208,7 @@ func TestRTSPServerAuthFail(t *testing.T) {
|
|
|
|
|
"hls: no\n" + |
|
|
|
|
"webrtc: no\n" + |
|
|
|
|
"paths:\n" + |
|
|
|
|
" all:\n" + |
|
|
|
|
" all_others:\n" + |
|
|
|
|
" publishIPs: [128.0.0.1/32]\n") |
|
|
|
|
require.Equal(t, true, ok) |
|
|
|
|
defer p.Close() |
|
|
|
@ -227,7 +227,7 @@ func TestRTSPServerAuthFail(t *testing.T) {
@@ -227,7 +227,7 @@ func TestRTSPServerAuthFail(t *testing.T) {
|
|
|
|
|
t.Run("external", func(t *testing.T) { |
|
|
|
|
p, ok := newInstance("externalAuthenticationURL: http://localhost:9120/auth\n" + |
|
|
|
|
"paths:\n" + |
|
|
|
|
" all:\n") |
|
|
|
|
" all_others:\n") |
|
|
|
|
require.Equal(t, true, ok) |
|
|
|
|
defer p.Close() |
|
|
|
|
|
|
|
|
@ -254,7 +254,7 @@ func TestRTSPServerPublisherOverride(t *testing.T) {
@@ -254,7 +254,7 @@ func TestRTSPServerPublisherOverride(t *testing.T) {
|
|
|
|
|
t.Run(ca, func(t *testing.T) { |
|
|
|
|
conf := "rtmp: no\n" + |
|
|
|
|
"paths:\n" + |
|
|
|
|
" all:\n" |
|
|
|
|
" all_others:\n" |
|
|
|
|
|
|
|
|
|
if ca == "disabled" { |
|
|
|
|
conf += " overridePublisher: no\n" |
|
|
|
|