I don’t want to be SUPERMAN…… because I’m LQman……

Mei 29, 2011

how to use socks proxy from wget

Warning : This post is my own note, you may believe on it or not. :P

Before continue read this post, I recommend you to read this post as preface.

Linux / BSD user usually familiar with shell, and wget is very usefull tool for download from shell. In this post I will explain how can wget use SOCKS proxy.

What is socks ?
From wikipedia “SOCKS is an Internet protocol that facilitates the routing of network packets between client–server applications via a proxy server. SOCKS performs at Layer 5 of the OSI model—the session layer (an intermediate layer between the presentation layer and the transport layer).”

Ok, this is the step.

  1. Create the tunnel (from another tty or ttyv or terminal). I use ssh to create tunnel on localhost port 9999. You may create the tunnel with ping tunnel (ptunnel) or another tools.
  2. lqman@development:~$ ssh -D 9999 -C lqman@180.247.xxx.xxx
    lqman@180.247.xxx.xxx's password : xxxxxxxx

    -D : bind on spesific port
    -C : compress the connection [optional]

  3. Check wheather the tunnel successfully created or not.
  4. lqman@development:~$ sudo netstat -atupln | grep 9999
    tcp 0 0 127.0.0.1:9999 0.0.0.0:* LISTEN 13680/ssh
    tcp6 0 0 ::1:9999 :::* LISTEN 13680/ssh

    if the LISTEN state appear, it means the tunnel has created successfully (on locahost port 9999) and ready to use.

  5. install tsocks
  6. lqman@development:~$ sudo aptitude install tsocks

  7. configure tsocks, uncomment every line, except three lines below, and
  8. lqman@development:~$ sudo vim /etc/tsocks.conf
    server = 127.0.0.1
    server_type = 5
    server_port = 9999

  9. Try to download with wget
  10. lqman@development:~$ tsocks wget google.com
    --2011-05-29 16:56:59-- http://google.com/
    Resolving google.com... 74.125.71.105, 74.125.71.106, 74.125.71.147, ...
    Connecting to google.com|74.125.71.105|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: http://www.google.com/ [following]
    --2011-05-29 16:56:59-- http://www.google.com/
    Resolving www.google.com... 74.125.71.106, 74.125.71.147, 74.125.71.99, ...
    Connecting to www.google.com|74.125.71.106|:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: http://www.google.co.id/ [following]
    --2011-05-29 16:57:00-- http://www.google.co.id/
    Resolving www.google.co.id... 74.125.71.105, 74.125.71.106, 74.125.71.147, ...
    Connecting to www.google.co.id|74.125.71.105|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [text/html]
    Saving to: “index.html”
    [ ] 10,182 37.5K/s in 0.3s
    2011-05-29 16:57:01 (37.5 KB/s) - “index.html” saved [10182]

    Thats all folks….
    Happy tunnelling & downloading dude.

    reference :
    http://www.dslreports.com/forum/remark,13563828
    man wget

Tinggalkan sebuah Komentar »

Belum ada komentar.

RSS umpan untuk komentar-komentar dalam tulisan ini. URI Lacak Balik

Tinggalkan Balasan

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Ubah )

Twitter picture

You are commenting using your Twitter account. Log Out / Ubah )

Facebook photo

You are commenting using your Facebook account. Log Out / Ubah )

Connecting to %s

Tema: Silver is the New Black. Blog pada WordPress.com.

Ikuti

Get every new post delivered to your Inbox.