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

  • münchen

    On that note: I'm living in Munich for the next week plus a few days. Do I know anyone around here? (PS: The LJ → PubSubHubbub → Reader…

  • deb/rpm diffing tools

    Dear Linux hackers, Chrome tends to push minor updates (often security) pretty frequently. We'd like to operate as a good member of the Linux…

  • emacs

    I've been using vim for a very long time -- over ten years -- but over those years I've envied more and more the way emacs integrates other software.…

  • 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