'''
VPProxy configuration script
Edit this file.
'''

import logging

class VPConfig():

    # Message level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
    debug = logging.WARNING
    # HTTP Server host
    httphost = '0.0.0.0'
    # HTTP Server port
    httpport = 8001
    # If started as root, drop privileges to this user.
    # Leave empty to disable.
    vpproxyuser = 'vpproxy'
    # Enable firewall
    firewall = False
    # Firewall mode. True for blackilst, False for whitelist
    firewallblacklistmode = False
    # Network ranges. Please don't forget about comma in the end
    # of every range, especially if there is only one.
    firewallnetranges = (
        '127.0.0.1',
        '192.168.0.0/16',
        '10.8.0.0/16',
        )
    # Maximum concurrent connections (video clients)
    maxconns = 20
    # Logging to a file
    loggingtoafile = True
    # Path for logs, default is current directory. For example '/tmp/'
    logpath = '/var/log/vpproxy/'
    #
    # ----------------------------------------------------
    # VLC configuration
    # ----------------------------------------------------
    #
    # VLC cmd line (use `--file-logging --logfile=filepath` to write log)
    vlccmd = "cvlc -I telnet --clock-jitter 0 --network-caching 500 --sout-mux-caching 2000 --telnet-password admin --telnet-port 4212 --http-user-agent=\"SmartLabs/1.5.9\""
    # VLC spawn timeout
    # Adjust this if you get error 'Cannot spawn VLC!'
    vlcspawntimeout = 15
    # VLC host
    vlchost = '127.0.0.1'
    # VLC telnet interface port
    vlcport = 4212
    # VLC streaming port (you shouldn't set it in VLC itself)
    vlcoutport = 8099
    # VLC telnet interface password
    vlcpass = 'admin'
    # Pre-access (HTTP) VLC parameters
    # You can add transcode options here
    # Something like #transcode{acodec=mpga,ab=128,channels=2,samplerate=44100}
    vlcpreaccess = ''
    # VLC muxer. You probably want one of these streamable muxers:
    # ts, asf, flv, ogg, mkv
    # You can use ffmpeg muxers too, if your VLC is built with it
    # ffmpeg{mux=NAME} (i.e. ffmpeg{mux=mpegts})
    # VLC's ts muxer sometimes can work badly, but that's the best choice for
    # now.
    vlcmux = 'ts'
    # Force ffmpeg INPUT demuxer in VLC. Sometimes can help.
    vlcforceffmpeg = False
    # Delay before closing connection when client disconnects
    # In seconds.
    videodestroydelay = 30
    # Pre-buffering timeout. In seconds.
    videotimeout = 45
    #
    # Some video players (mostly STBs and Smart TVs) can generate dummy requests
    # to detect MIME-type or something before playing.
    # We send them 200 OK and do nothing.
    # We add their User-Agents here
    fakeuas = ('Mozilla/5.0 IMC plugin Macintosh', )
    #
    # Some video players have very short timeout and can disconnect from the proxy
    # before the headers sent.
    # We send them 200 OK and MPEG MIME-type right after connection has been initiated
    fakeheaderuas = ('HLS Client/2.0 (compatible; LG NetCast.TV-2012)',
                     'Mozilla/5.0 (DirectFB; Linux armv7l) AppleWebKit/534.26+ (KHTML, like Gecko) Version/5.0 Safari/534.26+ LG Browser/5.00.00(+mouse+3D+SCREEN+TUNER; LGE; 42LM670T-ZA; 04.41.03; 0x00000001;); LG NetCast.TV-2012 0',
                     )
