Evan Martin (evan) wrote in evan_tech,
Evan Martin
evan
evan_tech

socks5 proxying flash via ssh

Suppose you're in Germany and want to watch some Flash-based videos that are IP-limited to the US for whatever reason. At first you'd think you could set up a proxy in the US and just tell your browser to use that, but it seems that Flash makes its own network connections on the side, and it's not clear how to configure that.

(Perhaps it reaches into the Mozilla settings? Perhaps this just works in Mozilla when you have a proxy set up?
$ strings /etc/alternatives/mozilla-flashplugin | grep \\.proxy
network.proxy.type
network.proxy.http
network.proxy.http_port
network.proxy.ssl
network.proxy.ssl_port
Hmm.)

In any case, it's actually even more trivial to set up a socks5 proxy via ssh and LD_PRELOAD over all the connection functions so no matter how the program connects, it gets your proxy.
  1. sudo apt-get install tsocks (this is the preloader)
  2. sudo vi /etc/tsocks.conf, remove the example block, and add in
    server = 127.0.0.1
    server_type = 5
    server_port = 1080
    at the bottom in the defaults area
  3. ssh -D 1080 box-in-america (or add a DynamicForward 1080 line to the appropriate stanza in your ~/.ssh/config)
  4. tsocks firefox (I didn't try Chrome -- I was worried that our multiple processes and loaders would eat the LD_PRELOAD, but actually all the network is done by the outermost process so it perhaps ought to work)
Note that, as compared to proxying HTTP via ssh, you don't need to run an HTTP proxy on box-in-america -- ssh does the proxying implicitly. However, it seems perhaps slower than an HTTP proxy.
Tags: howto, linux
Subscribe

  • blog moved

    As described elsewhere, I've quit LiveJournal. If you're interested in my continuing posts, you should look at one of these (each contains feed…

  • dremel

    They published a paper on Dremel, my favorite previously-unpublished tool from the Google toolchest. Greg Linden discusses it: "[...] it is capable…

  • treemaps

    I finally wrote up my recent adventures in treemapping, complete with nifty clickable visualizations.

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 3 comments