From 77109592816abcb3e8c6bc4e4528a04496f24780 Mon Sep 17 00:00:00 2001 From: dexter <178529795@qq.com> Date: Thu, 12 May 2022 09:11:47 +0800 Subject: [PATCH] =?UTF-8?q?streamPath=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=98=B2=E6=AD=A2=E6=84=8F=E5=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 3731cd0..8e08c17 100644 --- a/main.go +++ b/main.go @@ -83,7 +83,7 @@ func (conf *WebRTCConfig) OnEvent(event any) { func (conf *WebRTCConfig) Play_(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/sdp") - streamPath := r.URL.Path[12:] + streamPath := r.URL.Path[len("/webrtc/play/"):] bytes, err := ioutil.ReadAll(r.Body) var suber WebRTCSubscriber suber.SDP = string(bytes) @@ -112,7 +112,7 @@ func (conf *WebRTCConfig) Play_(w http.ResponseWriter, r *http.Request) { } func (conf *WebRTCConfig) Push_(w http.ResponseWriter, r *http.Request) { - streamPath := r.URL.Path[12:] + streamPath := r.URL.Path[len("/webrtc/push/"):] w.Header().Set("Content-Type", "application/sdp") bytes, err := ioutil.ReadAll(r.Body) var puber WebRTCPublisher