Giter Site home page Giter Site logo

rust-iptv-proxy's Introduction

Usage

Usage: iptv [OPTIONS] --user <USER> --passwd <PASSWD> --mac <MAC>

Options:
  -u, --user <USER>                      Login username
  -p, --passwd <PASSWD>                  Login password
  -m, --mac <MAC>                        MAC address
  -i, --imei <IMEI>                      IMEI [default: ]
  -b, --bind <BIND>                      Bind address:port [default: 127.0.0.1:7878]
  -a, --address <ADDRESS>                IP address/interface name [default: ]
  -I, --interface <INTERFACE>            Interface to request
      --extra-playlist <EXTRA_PLAYLIST>  Url to extra m3u
      --extra-xmltv <EXTRA_XMLTV>        Url to extra xmltv
      --udp-proxy                        UDP proxy address:port
      --rtsp-proxy                       Use rtsp proxy
  -h, --help                             Print help
  -V, --version                          Print version

Endpoints

  • /playlist: m3u8 list
  • /xmltv: EGP

Example init.d

#!/bin/sh /etc/rc.common

START=99
STOP=99

MAC=
USER=
PASSWD=
INTERFACE=pppoe-iptv
BIND=0.0.0.0:7878

start() {
        ( RUST_LOG=info /usr/bin/iptv -u $USER -p $PASSWD -m $MAC -b $BIND -I $INTERFACE --udp-proxy --rtsp-proxy 2>&1 & echo $! >&3 ) 3>/var/run/iptv.pid | logger -t "iptv-proxy" &
}

stop() {
        if [ -f /var/run/iptv.pid ]; then
                kill -9 $(cat /var/run/iptv.pid) 2>/dev/null
                rm -f /var/run/iptv.pid
        fi
}

Build for openwrt

You don't need to install openwrt sdk for this.

rustup target add -v x86_64-unknown-linux-musl
cargo build -r --target x86_64-unknown-linux-musl

Append --features rustls-tls if need tls support.

To reduce binary size, you need to install openwrt sdk to ${openwrt}, and then build with

rustup toolchain install nightly
toolchain="$(ls -d ${openwrt}/staging_dir/toolchain-x86_64_gcc-*_musl)"
export RUSTFLAGS="-C target-feature=-crt-static -Zlocation-detail=none -C linker=${toolchain}/bin/x86_64-openwrt-linux-gcc"
cargo +nightly build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort -r --target x86_64-unknown-linux-musl

Build with openssl for openwrt

You need to install openwrt sdk to ${openwrt}, and then prepare:

cd ${openwrt}
./scripts/feeds update
./scripts/feeds install openssl
make V=s -j$(nproc)

Then build with

rustup target add -v x86_64-unknown-linux-musl
export PKG_CONFIG_SYSROOT_DIR=${openwrt}/staging_dir/target-x86_64_musl
toolchain="$(ls -d ${openwrt}/staging_dir/toolchain-x86_64_gcc-*_musl)"
export TARGET_CC=${toolchain}/bin/x86_64-openwrt-linux-gcc
export STAGING_DIR=${openwrt}/staging_dir/target-x86_64_musl
export RUSTFLAGS="-C target-feature=-crt-static -C linker=${toolchain}/bin/x86_64-openwrt-linux-gcc"
cargo build -r --target x86_64-unknown-linux-musl --features tls

rust-iptv-proxy's People

Contributors

yujincheng08 avatar rsplwe avatar

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.