|
|
|
@ -68,24 +68,23 @@ func TestServerNotFound(t *testing.T) {
@@ -68,24 +68,23 @@ func TestServerNotFound(t *testing.T) {
|
|
|
|
|
} { |
|
|
|
|
t.Run(ca, func(t *testing.T) { |
|
|
|
|
s := &Server{ |
|
|
|
|
Address: "127.0.0.1:8888", |
|
|
|
|
Encryption: false, |
|
|
|
|
ServerKey: "", |
|
|
|
|
ServerCert: "", |
|
|
|
|
ExternalAuthenticationURL: "", |
|
|
|
|
AlwaysRemux: ca == "always remux on", |
|
|
|
|
Variant: conf.HLSVariant(gohlslib.MuxerVariantMPEGTS), |
|
|
|
|
SegmentCount: 7, |
|
|
|
|
SegmentDuration: conf.StringDuration(1 * time.Second), |
|
|
|
|
PartDuration: conf.StringDuration(200 * time.Millisecond), |
|
|
|
|
SegmentMaxSize: 50 * 1024 * 1024, |
|
|
|
|
AllowOrigin: "", |
|
|
|
|
TrustedProxies: conf.IPsOrCIDRs{}, |
|
|
|
|
Directory: "", |
|
|
|
|
ReadTimeout: conf.StringDuration(10 * time.Second), |
|
|
|
|
WriteQueueSize: 512, |
|
|
|
|
PathManager: &dummyPathManager{}, |
|
|
|
|
Parent: &test.NilLogger{}, |
|
|
|
|
Address: "127.0.0.1:8888", |
|
|
|
|
Encryption: false, |
|
|
|
|
ServerKey: "", |
|
|
|
|
ServerCert: "", |
|
|
|
|
AlwaysRemux: ca == "always remux on", |
|
|
|
|
Variant: conf.HLSVariant(gohlslib.MuxerVariantMPEGTS), |
|
|
|
|
SegmentCount: 7, |
|
|
|
|
SegmentDuration: conf.StringDuration(1 * time.Second), |
|
|
|
|
PartDuration: conf.StringDuration(200 * time.Millisecond), |
|
|
|
|
SegmentMaxSize: 50 * 1024 * 1024, |
|
|
|
|
AllowOrigin: "", |
|
|
|
|
TrustedProxies: conf.IPsOrCIDRs{}, |
|
|
|
|
Directory: "", |
|
|
|
|
ReadTimeout: conf.StringDuration(10 * time.Second), |
|
|
|
|
WriteQueueSize: 512, |
|
|
|
|
PathManager: &dummyPathManager{}, |
|
|
|
|
Parent: &test.NilLogger{}, |
|
|
|
|
} |
|
|
|
|
err := s.Initialize() |
|
|
|
|
require.NoError(t, err) |
|
|
|
@ -131,24 +130,23 @@ func TestServerRead(t *testing.T) {
@@ -131,24 +130,23 @@ func TestServerRead(t *testing.T) {
|
|
|
|
|
pathManager := &dummyPathManager{stream: stream} |
|
|
|
|
|
|
|
|
|
s := &Server{ |
|
|
|
|
Address: "127.0.0.1:8888", |
|
|
|
|
Encryption: false, |
|
|
|
|
ServerKey: "", |
|
|
|
|
ServerCert: "", |
|
|
|
|
ExternalAuthenticationURL: "", |
|
|
|
|
AlwaysRemux: false, |
|
|
|
|
Variant: conf.HLSVariant(gohlslib.MuxerVariantMPEGTS), |
|
|
|
|
SegmentCount: 7, |
|
|
|
|
SegmentDuration: conf.StringDuration(1 * time.Second), |
|
|
|
|
PartDuration: conf.StringDuration(200 * time.Millisecond), |
|
|
|
|
SegmentMaxSize: 50 * 1024 * 1024, |
|
|
|
|
AllowOrigin: "", |
|
|
|
|
TrustedProxies: conf.IPsOrCIDRs{}, |
|
|
|
|
Directory: "", |
|
|
|
|
ReadTimeout: conf.StringDuration(10 * time.Second), |
|
|
|
|
WriteQueueSize: 512, |
|
|
|
|
PathManager: pathManager, |
|
|
|
|
Parent: &test.NilLogger{}, |
|
|
|
|
Address: "127.0.0.1:8888", |
|
|
|
|
Encryption: false, |
|
|
|
|
ServerKey: "", |
|
|
|
|
ServerCert: "", |
|
|
|
|
AlwaysRemux: false, |
|
|
|
|
Variant: conf.HLSVariant(gohlslib.MuxerVariantMPEGTS), |
|
|
|
|
SegmentCount: 7, |
|
|
|
|
SegmentDuration: conf.StringDuration(1 * time.Second), |
|
|
|
|
PartDuration: conf.StringDuration(200 * time.Millisecond), |
|
|
|
|
SegmentMaxSize: 50 * 1024 * 1024, |
|
|
|
|
AllowOrigin: "", |
|
|
|
|
TrustedProxies: conf.IPsOrCIDRs{}, |
|
|
|
|
Directory: "", |
|
|
|
|
ReadTimeout: conf.StringDuration(10 * time.Second), |
|
|
|
|
WriteQueueSize: 512, |
|
|
|
|
PathManager: pathManager, |
|
|
|
|
Parent: &test.NilLogger{}, |
|
|
|
|
} |
|
|
|
|
err = s.Initialize() |
|
|
|
|
require.NoError(t, err) |
|
|
|
@ -217,24 +215,23 @@ func TestServerRead(t *testing.T) {
@@ -217,24 +215,23 @@ func TestServerRead(t *testing.T) {
|
|
|
|
|
pathManager := &dummyPathManager{stream: stream} |
|
|
|
|
|
|
|
|
|
s := &Server{ |
|
|
|
|
Address: "127.0.0.1:8888", |
|
|
|
|
Encryption: false, |
|
|
|
|
ServerKey: "", |
|
|
|
|
ServerCert: "", |
|
|
|
|
ExternalAuthenticationURL: "", |
|
|
|
|
AlwaysRemux: true, |
|
|
|
|
Variant: conf.HLSVariant(gohlslib.MuxerVariantMPEGTS), |
|
|
|
|
SegmentCount: 7, |
|
|
|
|
SegmentDuration: conf.StringDuration(1 * time.Second), |
|
|
|
|
PartDuration: conf.StringDuration(200 * time.Millisecond), |
|
|
|
|
SegmentMaxSize: 50 * 1024 * 1024, |
|
|
|
|
AllowOrigin: "", |
|
|
|
|
TrustedProxies: conf.IPsOrCIDRs{}, |
|
|
|
|
Directory: "", |
|
|
|
|
ReadTimeout: conf.StringDuration(10 * time.Second), |
|
|
|
|
WriteQueueSize: 512, |
|
|
|
|
PathManager: pathManager, |
|
|
|
|
Parent: &test.NilLogger{}, |
|
|
|
|
Address: "127.0.0.1:8888", |
|
|
|
|
Encryption: false, |
|
|
|
|
ServerKey: "", |
|
|
|
|
ServerCert: "", |
|
|
|
|
AlwaysRemux: true, |
|
|
|
|
Variant: conf.HLSVariant(gohlslib.MuxerVariantMPEGTS), |
|
|
|
|
SegmentCount: 7, |
|
|
|
|
SegmentDuration: conf.StringDuration(1 * time.Second), |
|
|
|
|
PartDuration: conf.StringDuration(200 * time.Millisecond), |
|
|
|
|
SegmentMaxSize: 50 * 1024 * 1024, |
|
|
|
|
AllowOrigin: "", |
|
|
|
|
TrustedProxies: conf.IPsOrCIDRs{}, |
|
|
|
|
Directory: "", |
|
|
|
|
ReadTimeout: conf.StringDuration(10 * time.Second), |
|
|
|
|
WriteQueueSize: 512, |
|
|
|
|
PathManager: pathManager, |
|
|
|
|
Parent: &test.NilLogger{}, |
|
|
|
|
} |
|
|
|
|
err = s.Initialize() |
|
|
|
|
require.NoError(t, err) |
|
|
|
|