in reply to LWP Request Through SOCKS Proxy

everything makes me think that you can't

libwww (the C library that LWP wraps) has some support for SOCKS proxies, but it seems that this functionality is not available from perl.

I can see two work arounds:

1) the difficult one: go hacking inside LWP and make the SOCKS support available in perl. Don't forget to submmit a patch to the maintainer ;-)

2) the no so difficult one: code an standalone HTTP proxy => SOCKS gateway. Maybe you can do it combining HTTP::Proxy and Net::SOCKS or IO::Socket::Socks.

You can also check LWP alternatives like curl or neon, both have perl wrappers, though I doubt they can support SOCKS either.

Replies are listed 'Best First'.
Re^2: LWP Request Through SOCKS Proxy
by gam3 (Curate) on Apr 19, 2005 at 01:42 UTC
    You can just open a local socket and have it connect to the SOCKS server. So you give LWP an address like http://localhost:8080/. Update: added code sample
    -- gam3
    A picture is worth a thousand words, but takes 200K.
      What do you mean?

      You need to talk using the SOCKS protocol with the SOCKS server, so you need a gateway between LWP (than can only talk to HTTP proxies) and the SOCKS server

      (after the update) I see, but this aproach is going to fail in all but the simplest cases: if the remote server runs several virtual servers, if it includes absolute URLs in some response or in redirects, etc.