mirror of
https://github.com/pierre-emmanuelJ/iptv-proxy.git
synced 2026-03-13 14:46:16 +01:00
Signed-off-by: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com> fixup! Add basic auth, fix xtream path Signed-off-by: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com> fixup! fixup! Add basic auth, fix xtream path Signed-off-by: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com>
57 lines
1.7 KiB
Go
57 lines
1.7 KiB
Go
/*
|
|
* Iptv-Proxy is a project to proxyfie an m3u file and to proxyfie an Xtream iptv service (client API).
|
|
* Copyright (C) 2020 Pierre-Emmanuel Jacquier
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
package config
|
|
|
|
import (
|
|
"net/url"
|
|
)
|
|
|
|
// CredentialString represents an iptv-proxy credential.
|
|
type CredentialString string
|
|
|
|
// PathEscape escapes the credential for an url path.
|
|
func (c CredentialString) PathEscape() string {
|
|
return url.PathEscape(string(c))
|
|
}
|
|
|
|
// String returns the credential string.
|
|
func (c CredentialString) String() string {
|
|
return string(c)
|
|
}
|
|
|
|
// HostConfiguration containt host infos
|
|
type HostConfiguration struct {
|
|
Hostname string
|
|
Port int64
|
|
}
|
|
|
|
// ProxyConfig Contain original m3u playlist and HostConfiguration
|
|
type ProxyConfig struct {
|
|
HostConfig *HostConfiguration
|
|
XtreamUser CredentialString
|
|
XtreamPassword CredentialString
|
|
XtreamBaseURL string
|
|
M3UCacheExpiration int
|
|
M3UFileName string
|
|
CustomEndpoint string
|
|
RemoteURL *url.URL
|
|
HTTPS bool
|
|
User, Password CredentialString
|
|
}
|