Example #1
0
        private static void StartServers(Options options)
        {
            Configuration config = null;
            if(options.DefaultConfig)
            {
                config = Configuration.Default;
                config.Save(options.ConfigFile);
            }
            else
                config = Configuration.Load(options.ConfigFile);

            State state = new State(config, options.Level);

            AdvDnsServer dns = new AdvDnsServer(state, options.Intercept);
            dns.Start();

            if(options.Intercept)
            {
                AdvWebServer web = new AdvWebServer(state);
                web.Start();
            }
        }
Example #2
0
 public AdvDnsServer(State state, bool intercept)
 {
     state_ = state;
     intercept_ = intercept;
 }
 public CertificatesManager(State state)
 {
     state_ = state;
 }
Example #4
0
 public AdvWebServer(State state)
 {
     state_ = state;
     interceptor_ = new Interceptor(state);
     certificatesMgr_ = new CertificatesManager(state);
 }
 internal DnsProcessQuery(State state, IPAddress defaultIp)
 {
     state_ = state;
     defaultIp_ = defaultIp;
 }
 internal DnsProcessAQuery(State state, IPAddress defaultIp)
     : base(state, defaultIp)
 {
 }
Example #7
0
        public Interceptor(State state)
        {
            state_ = state;

            if(string.IsNullOrEmpty(state_.Config.Proxy.Server))
                state_.Logger.Config("No proxy");
            else
                state_.Logger.Config("Use proxy {0}:{1}", state_.Config.Proxy.Server, state_.Config.Proxy.Port);
        }