Beispiel #1
0
 public override void handlePOSTRequest(HttpProcessor p, StreamReader inputData)
 {
     Console.WriteLine("POST request: {0}", (object)p.http_url);
     inputData.ReadToEnd();
     p.writeSuccess("text/html");
     p.outputStream.WriteLine("");
 }
Beispiel #2
0
        public override void handleGETRequest(HttpProcessor p)
        {
            Console.WriteLine("request: {0}", (object)p.http_url);
            p.writeSuccess("text/html");
            string stringForKey = LocalConfig.getCurrentConfig().getStringForKey("ProxyTool");
            string ip           = LocalConfig.getCurrentConfig().myIP;

            if (p.httpHeaders[(object)"User-Agent"].ToString().Contains("networkd"))
            {
                this.frmMainObj.lbProxyStatus.Invoke(new Action(delegate
                {
                    this.frmMainObj.lbProxyStatus.Text      = "Proxy configured";
                    this.frmMainObj.lbProxyStatus.ForeColor = Color.Green;
                }));
            }
            int sshAndVip72Port = LocalConfig.getCurrentConfig().getSSHAndVip72Port();

            if (stringForKey.Equals("SSH"))
            {
                p.outputStream.WriteLine("function FindProxyForURL(url, host) {\r\nreturn \"SOCKS " + ip + ":" + (object)sshAndVip72Port + "\";\r\n}");
            }
            else
            {
                p.outputStream.WriteLine("function FindProxyForURL(url, host) {\r\nreturn \"SOCKS " + ip + ":" + (object)sshAndVip72Port + "\";\r\n}");
            }
        }