External httpClient support

This commit is contained in:
kikimor
2021-02-24 21:47:09 +05:00
parent 6a2c796805
commit 51ae55e8a0
6 changed files with 47 additions and 89 deletions

View File

@@ -27,12 +27,15 @@ func readResponse(resp *http.Response) string {
func main() {
//Getting an camera instance
dev, err := goonvif.NewDevice("192.168.13.14:80")
dev, err := goonvif.NewDevice(goonvif.DeviceParams{
Xaddr: "192.168.13.14:80",
Username: login,
Password: password,
HttpClient: new(http.Client),
})
if err != nil {
panic(err)
}
//Authorization
dev.Authenticate(login, password)
//Preparing commands
systemDateAndTyme := device.GetSystemDateAndTime{}