Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix XMLTV proxy routing issue and Xtream Codes VOD data handling #176

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
iptv-proxy
iptv/iptv.m3u

# Backup files
*.bak

3 changes: 3 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ var rootCmd = &cobra.Command{
Use: "iptv-proxy",
Short: "Reverse proxy on iptv m3u file and xtream codes server api",
Run: func(cmd *cobra.Command, args []string) {

log.Printf("[iptv-proxy] Server is starting...")

m3uURL := viper.GetString("m3u-url")
remoteHostURL, err := url.Parse(m3uURL)
if err != nil {
Expand Down
9 changes: 6 additions & 3 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ func NewServer(config *config.ProxyConfig) (*Config, error) {
}
}

if trimmedCustomId := strings.Trim(config.CustomId, "/"); trimmedCustomId != "" {
endpointAntiColision = trimmedCustomId
}
if trimmedCustomId := strings.Trim(config.CustomId, "/"); trimmedCustomId != "" {
endpointAntiColision = trimmedCustomId
}

return &Config{
config,
Expand All @@ -88,6 +88,9 @@ func (c *Config) Serve() error {
group := router.Group("/")
c.routes(group)

// Add a message to indicate the server is ready
log.Printf("[iptv-proxy] Server is ready and listening on :%d", c.HostConfig.Port)

return router.Run(fmt.Sprintf(":%d", c.HostConfig.Port))
}

Expand Down