greetings, fellow internet!

welcome to digitalgangster.com, the coolest community for people who hack the gibson and make bajillions of dollars off of online marketing. this version of the forum is in view only mode for archival purposes. the new forum can be found here.

ASGPHE,
ytcracker, original digital gangster
follow me on twitter
fan me on facebook
Results 1 to 6 of 6

Thread: Using SOCKS proxies for C#'s WebRequest.proxy (WebProxy only seems to do HTTP)

Hybrid View

  1. #1
    I am Fredryck Fox! Vershun's Avatar
    Join Date
    May 2005
    Location
    Denver, CO
    Posts
    16,131

    Default Using SOCKS proxies for C#'s WebRequest.proxy (WebProxy only seems to do HTTP)

    Hopefully if you guys can't help Google will like me.

    I just can't seem to find where or how I can use WebProxy to use SOCKS proxies. It seems like this support should be built into the .NET framework somewhere.

  2. #2

    Default

    2 options...

    a. say fuckit and sockscap it in the end
    b. build your own translation layer

    b is ugly and hackish, i'd be trying to avoid doing that too though :\

    you're right, should be there, but isn't.

  3. #3
    I am Fredryck Fox! Vershun's Avatar
    Join Date
    May 2005
    Location
    Denver, CO
    Posts
    16,131

    Default

    Quote Originally Posted by A2_ View Post
    2 options...

    a. say fuckit and sockscap it in the end
    b. build your own translation layer

    b is ugly and hackish, i'd be trying to avoid doing that too though :\

    you're right, should be there, but isn't.
    Argh >.<.

    Thinking about building my own locally run HTTP proxy that connects to SOCKS proxies as a way around it. ty for sockscap that looks interesting too.

  4. #4

    Default

    Quote Originally Posted by Vershun View Post
    Argh >.<.

    Thinking about building my own locally run HTTP proxy that connects to SOCKS proxies as a way around it. ty for sockscap that looks interesting too.
    You can use privoxy or a similar tool, (google "Tor") rather than write your own.

    Or you could ditch WebRequest and use the C# port/wrapper for cURL. That's what I do.

    If you manage to get a late enough version, it supports SOCKS5, SOCKS4 and SOCKS4a.

    csharp.cc

  5. #5

    Default

    This might be a strech, but the .NET WebProxy class supports WPAD (Microsoft's renaming of Netscape's proxy.pac auto configuration script for proxies.)

    If you configure WebProxy to use auto-discovery, and pass it the location of a WPAD file containing something like the following:


    Code:
    function FindProxyForURL(url, host) {
        if (dnsDomainIs(host, ".wherever.com"))
            return SOCKS5 localhost:1080;
        else
                          return DIRECT;
            }
    You might have a winner.

    You might also try to configure IE to use SOCKS, and then WebProxy.DefaultProxy. If you need to do this programatically:

    RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@”Software\Microso ft\Windows\CurrentVersion\Internet Settings", true);
    registryKey.SetValue("AutoConfigURL", "http://123.456.789.0");

    You might also investigate the Mentalis ProxySocket project, although this won't really help you unless you are prepared to write your own implementation of WebRequest.

    System.Net.WebProxy

    The WebProxy class supports automatic detection and execution of proxy configuration scripts. This feature is also known as Web Proxy Auto-Discovery (WPAD). When using automatic proxy configuration, a configuration script, typically named Wpad.dat, must be located, downloaded, compiled, and run. If these operations are successful, the script returns the proxies that can be used for a request.

    csharp.cc - a programmers guide to c# and girls

  6. #6
    *has a prince albert* Pacman's Avatar
    Join Date
    Apr 2005
    Location
    Silverlake, The City of Angels
    Posts
    4,422

    Default

    god this shit is so bad ... makes me cry.

Bookmarks

Posting Permissions

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