我的vps_ip可以设置为让wget使用的代理吗?

时间:2015-09-02 01:12:33

标签: shell proxy wget

有一个$ url被gfw阻止。
现在我想以这种方式从$ url下载内容。

ssh  root@vps_ip  #to use my vps_ip to break the gfw.      
wget -c  $url  -O /home/material  #to get the content on /home/material in my remote vps disk.      
scp root@vps_ip:/home/material    /home  #to get the /home/material in my remote vps disk into my local disk .  

我的vps_ip可以设置为让wget使用的代理吗?

2 个答案:

答案 0 :(得分:3)

http://www.baidu.com/search?q=wget+socks+proxy

https://unix.stackexchange.com/questions/38755/how-to-download-a-file-through-an-ssh-server

选项1,使用security/dante包中的socksify

sudo pkg_add dante

ssh -N -C -D 1080 root@$vps_ip &

SOCKS_SERVER=localhost:1080 socksify wget -c $url -O /home/material

选项2,通过stdout / stdin

进行下载
ssh -C root@$vps_ip "wget -O- $url" >> /home/material

答案 1 :(得分:1)

如果你有可以在http://example.com:8080使用,那么你可以告诉wget使用它:

export HTTP_PROXY=http://example.com:8080
wget http://different.example.com
相关问题