Пример #1
0
        private static void SetMachineProxy(int port, Interceptors interceptors)
        {
            foreach (string @override in Overrides)
            {
                if (INETOptions.Overrides.Contains(@override))
                {
                    continue;
                }
                INETOptions.Overrides.Add(@override);
            }

            string address = ("127.0.0.1:" + port);

            if (interceptors.HasFlag(Interceptors.HTTP))
            {
                INETOptions.HTTPAddress = address;
            }
            if (interceptors.HasFlag(Interceptors.HTTPS))
            {
                INETOptions.HTTPSAddress = address;
            }
            INETOptions.IsProxyEnabled         = true;
            INETOptions.IsIgnoringLocalTraffic = true;

            INETOptions.Save();
        }
Пример #2
0
        private static void ResetMachineProxy()
        {
            INETOptions.Overrides.Clear();
            INETOptions.IsIgnoringLocalTraffic = false;

            INETOptions.HTTPAddress    = null;
            INETOptions.HTTPSAddress   = null;
            INETOptions.IsProxyEnabled = false;

            INETOptions.Save();
        }