Git Product home page Git Product logo

m3uproxy's Introduction

M3U Proxy

Proxy written in Go. It will process an M3U response and transform the all channel addresses with new addresses. It was built taking with the purpose that all traffic goes through it.

Endpoints

  • GET /
$> curl http://${host}:${port}

Welcome to m3u proxy
  • GET /ping
$> curl http://${host}:${port}/ping

pong
  • GET /channels
$> curl http://localhost:9090/channels

#EXTM3U
#EXTINF:-1 tvg-id="ABC FHD" tvg-name="ABC FHD" tvg-logo="http://....png" group-title="group A"
http://localhost:9090/channels/5287
#EXTINF:-1 tvg-id="ABC HD" tvg-name="ABC HD" tvg-logo="http://....png" group-title="group A"
http://localhost:9090/channels/984
...
  • GET /channels/{id}
$> curl http://localhost:9090/channel/984

... stream ...
  • GET /channels/info/{id}
$> curl http://localhost:9090/channel/info/984

{
    Id: "984",
    Source: {
        Scheme: "http",
        Opaque: "",
        User: null,
        Host: "<originalHost>:<originalPort>,
        Path: "<original request uri to channel>",
        RawPath: "",
        ForceQuery: false,
        RawQuery: "",
        Fragment: ""
    }
}

FAQ

Requirements:

  • Golang >= 1.11
  • docker (if you whish to build the container)

How to build the proxy

go build m3uproxy/main.go

How to run locally with config file Requires config file. Look for example in config/config-dev.yml

go run m3uproxy/main.go -file <path to config file>

How to run locally with environment variables This is useful when running in a docker container

export M3U_PROXY_PORT="9090"
export M3U_PROXY_HOSTNAME="localhost"
export M3U_PROXY_CHANNELS_URL="<valid url to m3u list>"
go run m3uproxy/main.go

#or 

docker run -e M3U_PROXY_CHANNELS_URL="<valid url to m3u list>" -p 9090:9090  m3uproxy:latest
 

m3uproxy's People

Contributors

hmarcelino avatar

Stargazers

Jorge Javier avatar

Watchers

 avatar James Cloos avatar

Forkers

draz34

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.