0

I wrote a small app that dl youtube vids but like most company's they dont allow you to view youtube so i would like to incorporate a proxy option into my app to dl the youtube vids through a supplied proxy ip and port.

Thank you for your time.

3
Contributors
6
Replies
7
Views
8 Years
Discussion Span
Last Post by summey
0

If your are working with asp.net web application then it is easy and fast in asp.net using httpmodule.
Read this article - http://www.hanselman.com/blog/AnIPAddressBlockingHttpModuleForASPNETIn9Minutes.aspx
Extending ASP.NET Processing with HTTP Modules

This is a desktop application, I just want to learn how to implement proxy settings in my applications to give more privacy when using my apps. I read that the System.Net.WebProxy class could be the answer but im not sure anyone clarify this for me please

thank you for your post

0
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Web;
using System.IO;

namespace daniweb
{
  public partial class frmProxy : Form
  {
    public frmProxy()
    {
      InitializeComponent();
    }

    private bool useProxy;

    private void button1_Click(object sender, EventArgs e)
    {
      useProxy = true;
      WebProxy proxy = new WebProxy("146.57.249.99", 3124);
      HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(@"http://www.whatismyip.com");
      if (useProxy)
        req.Proxy = proxy;
      req.Method = "GET";
      HttpWebResponse objResponse = (HttpWebResponse)req.GetResponse();
      string htmlStuff;
      using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
      {
        htmlStuff = sr.ReadToEnd();
        sr.Close();
      }
      System.Diagnostics.Debugger.Break();
    }
  }
}
0

Awesome thank you i will try and implement this with in my apps.

Thank you again

0

You're welcome

Please mark this thread as solved if you have found a solution to your problem and good luck!

0

so with that implementation above how would i download a file going through a proxy?

for testing to see if it work i was trying to use the webbrowser control i couldn't get the webbrower control to use the proxy.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.