Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can my vps_ip be set as a proxy to let wget use with?

Tags:

shell

proxy

wget

There is a $url which is blocked by gfw.
Now i want to download the content from the $url this way.

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 .  

Can my vps_ip be set as a proxy to let wget use with?

like image 453
showkey Avatar asked Sep 02 '15 01:09

showkey


People also ask

What proxy does wget use?

Wget supports proxies for both HTTP and FTP retrievals. The standard way to specify proxy location, which Wget recognizes, is using the following environment variables: http_proxy. https_proxy.

How do I change wget proxy settings?

The proxy configuration for the wget command can be set via the command line interface during usage of the wget command. The -e use_proxy=yes http_proxy="proxy.linuxtect.com" option can be used to set a temporary proxy for the current command execution time.

How do I bypass wget proxy?

Or use wget --no-proxy command line option to override them.

Can cURL use proxy?

Using cURL with HTTP/HTTPS proxy If you are using a proxy correctly, the page will return an IP address that is different from your machine's, that is, the proxy's IP address. There are multiple ways to run curl with proxy command. The next section will cover sending proxy details as a command line argument.


1 Answers

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

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


Option 1, with the use of socksify from the security/dante package:

sudo pkg_add dante

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

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

Option 2, by piping the download through stdout / stdin:

ssh -C root@$vps_ip "wget -O- $url" >> /home/material
like image 127
cnst Avatar answered Sep 22 '22 23:09

cnst