mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-28 01:51:52 +08:00
External authentication support send url raw query
Do some dynamic authentication, such as token
This commit is contained in:
@@ -14,6 +14,7 @@ func externalAuth(
|
||||
password string,
|
||||
path string,
|
||||
action string,
|
||||
query string,
|
||||
) error {
|
||||
enc, _ := json.Marshal(struct {
|
||||
IP string `json:"ip"`
|
||||
@@ -21,12 +22,14 @@ func externalAuth(
|
||||
Password string `json:"password"`
|
||||
Path string `json:"path"`
|
||||
Action string `json:"action"`
|
||||
Query string `json:"query"`
|
||||
}{
|
||||
IP: ip,
|
||||
User: user,
|
||||
Password: password,
|
||||
Path: path,
|
||||
Action: action,
|
||||
Query: query,
|
||||
})
|
||||
res, err := http.Post(ur, "application/json", bytes.NewReader(enc))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user