2015-09-02 8 views
11

C'è un url $ che è bloccato da gfw.
Ora voglio scaricare il contenuto da $ url in questo modo.Il mio vps_ip può essere impostato come proxy per consentire l'utilizzo di wget?

ssh [email protected]_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 [email protected]_ip:/home/material /home #to get the /home/material in my remote vps disk into my local disk . 

Il mio vps_ip può essere impostato come proxy per consentire l'utilizzo di wget?

risposta

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


Opzione 1, con l'uso di socksify dal pacchetto security/dante:

sudo pkg_add dante 

ssh -N -C -D 1080 [email protected]$vps_ip & 

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

opzione 2, convogliando il download attraverso stdout/stdin:

ssh -C [email protected]$vps_ip "wget -O- $url" >> /home/material 
+0

a metà, è giusto per option2. –

+0

è 'ssh -N -D 1080 root @ $ vps_ip &' non 'ssh -N -D 1080 root @ vps_ip &' –

+0

SOCKS_SERVER = localhost: 1080 socksify wget -c $ url -O/home/materiale bash: socksify: comando non trovato –

1

Se si dispone è possibile utilizzare a http://example.com:8080 allora si può dire wget per utilizzarlo con:

export HTTP_PROXY=http://example.com:8080 
wget http://different.example.com 
+0

export http_proxy = http: // vps_ip: 8080 –

+0

wget -O www.google.com/home/cromo. html --2015-09-02 10: 29: 06-- http://www.google.com/ Risoluzione di www.google.com (www.google.com) ... 216.58.221.132, 2404: 6800 : 4005: 80b :: 2004 Connessione a www.google.com (www.google.com) | 216.58.221.132 |: 80 ... –

+0

Il cursore si ferma qui per sempre. –

Problemi correlati