Results 1 to 11 of 11

Thread: Connecting to a Webpage via a proxy

  1. #1

    Thread Starter
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    Connecting to a Webpage via a proxy

    Okay, I need to know two things here.

    #1 How to connect to a webpage through a proxy in Vb?
    #2 How to get a list of local proxy's, via Vb.

    Basicly I just want the user to be able to load the program, and get a list of local proxy's that work, and then connect to a webpage via that proxy. Thanks in advanced.

  2. #2

    Thread Starter
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    Re: Connecting to a Webpage via a proxy

    Well here is what I have tested so far:

    I am connecting with:

    Winsock.Connect "216.104.196.225", 80

    I checked if I was connected and it returns true, so I should be connected through that proxy now. Now, to test if it's working I added a browser control, and went to www.myipaddress.com and found that it was not actually connected through the proxy.

    To test that the proxy actually worked, I used the same one with one of my browsers, and went to the same site, and the Ip was the proxy, like it's supposed to be. So in a nutshell, I don't think the connection worked, any idea?

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Connecting to a Webpage via a proxy

    The Inet control properties let you enter a proxy.

  4. #4

    Thread Starter
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    Re: Connecting to a Webpage via a proxy

    Does that proxy only work for Inet? Because I am using Winsock to connect to the webpages for a certain reason, and I prefer to stay with it.
    Age - 15 ::: Level - Advanced
    If you find my post useful please ::Rate It::


  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Connecting to a Webpage via a proxy

    I think so. When you set up a proxy in IE, does apply to all internet connection?
    Maybe you could use the Internet Connection settings in Control panel?

  6. #6

    Thread Starter
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    Re: Connecting to a Webpage via a proxy

    I plan on doing this through a program. If Inet sets a proxy through your internet settings that would work, but how do you go about doing that?
    Age - 15 ::: Level - Advanced
    If you find my post useful please ::Rate It::


  7. #7
    Fanatic Member
    Join Date
    Jan 2005
    Location
    In front of this pc.
    Posts
    580

    Re: Connecting to a Webpage via a proxy

    Using winsock through a proxy isn't that difficult..you just set the connection to the proxy IPA and port and include the desired server in the get. i.e., instead of retrieving "/index.html" you would retrieve "destination_url/index.html"

  8. #8
    Lively Member
    Join Date
    May 2005
    Posts
    90

    Re: Connecting to a Webpage via a proxy

    As anotherVBnewbie said, HTTP-GET proxies are the easiest to use. Following up on that is the related CONNECT method proxy (ie: "CONNECT google.com:80") and SOCKS proxies. If you want to use socks, take a look at the RFC, it's pretty easy to understand.
    ^_^

  9. #9
    New Member
    Join Date
    Aug 2005
    Posts
    7

    Re: Connecting to a Webpage via a proxy

    Quote Originally Posted by Inuyasha1782
    Well here is what I have tested so far:

    I am connecting with:

    Winsock.Connect "216.104.196.225", 80

    I checked if I was connected and it returns true, so I should be connected through that proxy now. Now, to test if it's working I added a browser control, and went to www.myipaddress.com and found that it was not actually connected through the proxy.

    To test that the proxy actually worked, I used the same one with one of my browsers, and went to the same site, and the Ip was the proxy, like it's supposed to be. So in a nutshell, I don't think the connection worked, any idea?
    If you want to test if you connect through proxy via webbrowser activex control, don't think it will work. Cause webbrowser don't have a proxy setting properties.

    And for msinet openurl method, what does it return?

    I'm trying this kind of thing
    webbrowser.document=inet.openurl(....)

    won't work, anyone has an idea how can a webbrowser control use proxy to navigate the web?

    Thanks

  10. #10
    Lively Member
    Join Date
    May 2005
    Posts
    90

    Re: Connecting to a Webpage via a proxy

    I actually did something like this that required my VB6 app switch between real proxying and forwarding request to proxy servers. Since VB6 couldn't handle the "intense" nature of proxying, it crashed the IDE and everything.

    I tried to port the project to vb.net, but that failed too...damn .NET picky event-raising hierarchy
    ^_^

  11. #11
    Fanatic Member
    Join Date
    Jan 2005
    Location
    In front of this pc.
    Posts
    580

    Re: Connecting to a Webpage via a proxy

    To use winsock with a proxy all you have to do is use the proxy information as the connect info and then include the complete URL you are wishing to connect with in the get portion of the winsock string. I don't have any code here to post but you should be able to find examples on the net somewhere.

    If you use the inet api it will automatically be configured for the proxy if the user has entered the proxy information into IE and is, at least to me, the easiest way of enabling proxy use - not to mention that the winsock controller tends to memory leakage.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width