add sample credentials to client examples (#696)

This commit is contained in:
Alessandro Ros
2025-02-10 15:45:27 +01:00
committed by GitHub
parent ed078672e4
commit 770549f223
40 changed files with 41 additions and 41 deletions

View File

@@ -63,7 +63,7 @@ func main() {
}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -18,7 +18,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -18,7 +18,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -48,7 +48,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/stream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/stream")
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -24,7 +24,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -48,7 +48,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -24,7 +24,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -18,7 +18,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -22,7 +22,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -18,7 +18,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -18,7 +18,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -28,7 +28,7 @@ func main() {
}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -22,7 +22,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
reader := gortsplib.Client{}
// parse source URL
sourceURL, err := base.ParseURL("rtsp://localhost:8554/mystream")
sourceURL, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}
@@ -48,7 +48,7 @@ func main() {
// connect to the server and start recording the same medias
publisher := gortsplib.Client{}
err = publisher.StartRecording("rtsp://localhost:8554/mystream2", desc)
err = publisher.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream2", desc)
if err != nil {
panic(err)
}

View File

@@ -19,7 +19,7 @@ func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://localhost:8554/mystream")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}

View File

@@ -14,7 +14,7 @@ import (
func main() {
c := gortsplib.Client{}
u, err := base.ParseURL("rtsp://localhost:8554/mypath")
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mypath")
if err != nil {
panic(err)
}

View File

@@ -51,7 +51,7 @@ func main() {
c := gortsplib.Client{}
// connect to the server and start recording
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -46,7 +46,7 @@ func main() {
c := gortsplib.Client{}
// connect to the server and start recording
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -71,7 +71,7 @@ func main() {
// connect to the server, announce the format and start recording
c := gortsplib.Client{}
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -50,7 +50,7 @@ func main() {
// connect to the server and start recording
c := gortsplib.Client{}
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -48,7 +48,7 @@ func main() {
// connect to the server and start recording
c := gortsplib.Client{}
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -51,7 +51,7 @@ func main() {
c := gortsplib.Client{}
// connect to the server and start recording
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -69,7 +69,7 @@ func main() {
// connect to the server, announce the format and start recording
c := gortsplib.Client{}
err := c.StartRecording("rtsp://localhost:8554/mystream", desc)
err := c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -45,7 +45,7 @@ func main() {
// connect to the server and start recording
c := gortsplib.Client{}
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -56,7 +56,7 @@ func main() {
// connect to the server and start recording
c := gortsplib.Client{}
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -48,7 +48,7 @@ func main() {
// connect to the server and start recording
c := gortsplib.Client{}
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -48,7 +48,7 @@ func main() {
// connect to the server and start recording
c := gortsplib.Client{}
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -48,7 +48,7 @@ func main() {
// connect to the server and start recording
c := gortsplib.Client{}
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -59,7 +59,7 @@ func main() {
}
// connect to the server and start recording
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -51,7 +51,7 @@ func main() {
// connect to the server and start recording
c := gortsplib.Client{}
err = c.StartRecording("rtsp://localhost:8554/mystream", desc)
err = c.StartRecording("rtsp://myuser:mypass@localhost:8554/mystream", desc)
if err != nil {
panic(err)
}

View File

@@ -12,7 +12,7 @@ import (
)
const (
existingStream = "rtsp://x.x.x.x:8554/mystream"
existingStream = "rtsp://myuser:mypass@x.x.x.x:8554/mystream"
reconnectPause = 2 * time.Second
)