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

  • use chrome as your emacs browser

    The emacs-configured browser is used for operations like previewing your markdown buffer ( markdown-preview; C-c C-c p in markdown-mode). I still…

  • recovering a disk clobbered with dd

    I managed to accidentally dd 600mb over my primary disk; I haven't done that in many years. Adam thankfully pointed out that my data should be…

  • git evangelism: enough already

    As a person who uses Git extensively and thoroughly, and as someone works on/around two large open source projects (Chrome, WebKit) that are managed…

  • 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