From 4dae99448b3262d2891e6bae262b6844999ca39d Mon Sep 17 00:00:00 2001 From: Ceyhun Can Ulker Date: Fri, 16 Oct 2020 20:26:51 +0300 Subject: [PATCH 1/2] Fix #8 - Do options request to resource path rather than / --- connclient.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connclient.go b/connclient.go index 32d57792..ac3accaf 100644 --- a/connclient.go +++ b/connclient.go @@ -356,7 +356,7 @@ func (c *ConnClient) Options(u *url.URL) (*base.Response, error) { Scheme: "rtsp", Host: u.Host, User: u.User, - Path: "/", + Path: u.Path, }, }) if err != nil { From 796f7c3d65dd38850bb4cbc920d282ac67cc9cf5 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Fri, 16 Oct 2020 22:59:24 +0200 Subject: [PATCH 2/2] use the stream path in every OPTIONS request (#8) --- connclient.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/connclient.go b/connclient.go index ac3accaf..5f8dd3c2 100644 --- a/connclient.go +++ b/connclient.go @@ -351,12 +351,12 @@ func (c *ConnClient) Options(u *url.URL) (*base.Response, error) { res, err := c.Do(&base.Request{ Method: base.OPTIONS, - // strip path Url: &url.URL{ Scheme: "rtsp", Host: u.Host, User: u.User, - Path: u.Path, + // use the stream path, otherwise some cameras do not reply + Path: u.Path, }, }) if err != nil { @@ -776,7 +776,8 @@ func (c *ConnClient) LoopUDP() error { Scheme: "rtsp", Host: c.streamUrl.Host, User: c.streamUrl.User, - Path: "/", + // use the stream path, otherwise some cameras do not reply + Path: c.streamUrl.Path, }, SkipResponse: true, })