rewrite ConnClient api; add examples

This commit is contained in:
aler9
2020-07-12 19:48:46 +02:00
parent 6b3c41d319
commit 4ca5f8157f
8 changed files with 316 additions and 77 deletions

View File

@@ -107,7 +107,15 @@ func readRequest(rb *bufio.Reader) (*Request, error) {
}
func (req *Request) write(bw *bufio.Writer) error {
_, err := bw.Write([]byte(string(req.Method) + " " + req.Url.String() + " " + _RTSP_PROTO + "\r\n"))
// remove credentials
u := &url.URL{
Scheme: req.Url.Scheme,
Host: req.Url.Host,
Path: req.Url.Path,
RawQuery: req.Url.RawQuery,
}
_, err := bw.Write([]byte(string(req.Method) + " " + u.String() + " " + _RTSP_PROTO + "\r\n"))
if err != nil {
return err
}