mkogg.py: Fix 'self.get_mp4_metadata(self, source)'
[blog.git] / posts / SOCKS.mdwn
1 Many journal articles are not freely available, but require some kind
2 of Drexel subscription.  Usually, they will seem free when you connect
3 from a Drexel IP address, but when you connect from home you have to
4 go through the whole rigmarole with Drexel Library's SFX doodad to get
5 your article.  What a pain.  I had previously [[SSH]]-tunneled my X
6 server out to newton, and fired up Firefox on newton.  Not much
7 better, since tunneling Firefox is *slow*.  [w3m][] is faster, but
8 without good JavaScript support a lot of “modern” sites leave you
9 without much functionality.  I discovered a neat solution courtesy of
10 [Carthik][].
11
12 You can get around the drag of forwarding X from newton, and just
13 forward the webpages directly by setting up a [SOCKS][] proxy with
14 [[SSH]].  This is done in a number of possible ways through SSH, but
15 the following two lines are the most common.  If you want to simply
16 carry the connection through without a shell opening:
17
18     $ ssh -fND localhost:9999 you@newton.physics.drexel.edu
19
20 if you want to open a tunnel and a shell at the same time, you could run:
21
22     $ ssh -D localhost:9999 you@newton.physics.drexel.edu
23
24 Now port 9999 on your computer takes you to a SOCKS proxy on Newton.
25 Open Firefox on your home computer and set it up to use the proxy with
26
27     Edit -> Preferences -> Advanced -> Network -> Settings -> Manual Proxy Configuration
28
29 And enter `localhost` and `9999` in the `SOCKS Host` fields.  Click
30 `OK` and you're done.
31
32 For bonus points, you can also make your DNS queries from Newton by
33 entering
34
35     about:config
36
37 in Firefox's URL field, and setting
38
39     network.proxy.socks_remote_dns
40
41 to `true`.
42
43 If you're tunneling your DNS queries, you can also use this method to
44 access services otherwise screened by intervening firewalls.  For
45 example, I can log in from home to check the status of our lab's
46 [[chemical inventory|ChemDB]], but the only port our router needs to
47 expose to incoming connections is for SSH.
48
49 [w3m]: http://w3m.sourceforge.net/
50 [Carthik]: http://ubuntu.wordpress.com/2006/12/08/ssh-tunnel-socks-proxy-forwarding-secure-browsing/
51 [SOCKS]: http://en.wikipedia.org/wiki/SOCKS