golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
498 B
31 lines
498 B
package webrtc |
|
|
|
import ( |
|
"context" |
|
"fmt" |
|
"net/http" |
|
) |
|
|
|
// WHIPDeleteSession deletes a WHIP/WHEP session. |
|
func WHIPDeleteSession( |
|
ctx context.Context, |
|
hc *http.Client, |
|
ur string, |
|
) error { |
|
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, ur, nil) |
|
if err != nil { |
|
return err |
|
} |
|
|
|
res, err := hc.Do(req) |
|
if err != nil { |
|
return err |
|
} |
|
defer res.Body.Close() |
|
|
|
if res.StatusCode != http.StatusOK { |
|
return fmt.Errorf("bad status code: %v", res.StatusCode) |
|
} |
|
|
|
return nil |
|
}
|
|
|