Forward user-agent

Signed-off-by: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com>
This commit is contained in:
Pierre-Emmanuel Jacquier
2020-09-11 16:20:12 +02:00
parent 49d529d94c
commit 398ce5b230
3 changed files with 34 additions and 7 deletions

View File

@@ -19,6 +19,7 @@
package xtreamproxy
import (
"context"
"fmt"
"net/http"
"net/url"
@@ -47,8 +48,8 @@ type Client struct {
}
// New new xtream client
func New(user, password, baseURL string) (*Client, error) {
cli, err := xtream.NewClient(user, password, baseURL)
func New(user, password, baseURL, userAgent string) (*Client, error) {
cli, err := xtream.NewClientWithUserAgent(context.Background(), user, password, baseURL, userAgent)
if err != nil {
return nil, err
}