示例#1
0
        public HTSConnectionHandler(ILogger logger, string baseUrl, TvHeadEndProviderOptions config)
        {
            _logger = logger;

            //System.Diagnostics.StackTrace t = new System.Diagnostics.StackTrace();
            _logger.Info("[TVHclient] HTSConnectionHandler()");

            _channelDataHelper = new ChannelDataHelper(logger);

            init(baseUrl, config);
        }
示例#2
0
        private void init(string baseUrl, TvHeadEndProviderOptions config)
        {
            _tvhServerName = new Uri(baseUrl).Host;
            _htspPort      = config.HTSP_Port;

            _userName = (config.Username ?? "").Trim();
            _password = (config.Password ?? "").Trim();

            _httpBaseUrl = baseUrl;

            string authInfo = _userName + ":" + _password;

            authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
            _headers["Authorization"] = "Basic " + authInfo;
        }