Search code examples
socketshaskellsshsockstunnel

Socks5 connection via Network.Browser


Is it possible to use Network.Browser with a SOCKSv5 connection? I opened a ssh tunnel using the Linux command line with ssh -C2qTnN -D 8080 username@remote_machine.com. Now I would like to be able to use use Network.Browser with this connection. ( I tried setProxy $ Proxy "localhost:8080" Nothing for Network.Browser, but this doesn't work...)

Thanks a lot for any suggestions!


Solution

  • tsocks can be used to SOCKS-enable anything. :P

    Looking at the source code of Network.Browser, there doesn't appear to be a "tunable" that would allow it to make connections through a SOCKS proxy. It can do an HTTP proxy, but I suspose that doesn't help much.

    While it is not quite as friendly as Network.Browser, I'd suggest switching to http-client. It does have a hook that would allow you to support SOCKS and it has functional SSL/TLS support in http-client-tls.