kevva / download

Download and extract files
MIT License
1.28k stars 200 forks source link

socks5 proxy #160

Open d668 opened 6 years ago

d668 commented 6 years ago

I am doing a ssh tunnel and it works fine in Firefox as socks5 proxy on 127.0.0.1:1089. When I do

var proxy = 'socks5://127.0.0.1:1089';
await download(imgUrl, './xxx/', { proxy: proxy, filename: 'xxx.jpg' });

i get

code:"ECONNRESET"
host:"..."
hostname:"..."
message:"tunneling socket could not be established, cause=socket hang up"
method:"GET"
name:"RequestError"
path:"..."
protocol:"https:"
stack:"RequestError: tunneling socket could not be established, cause=socket hang up\n    at ClientRequest.req.once.err (/home/.../node_modules/got/index.js:111:21)\n    at Object.onceWrapper (events.js:272:13)\n    at ClientRequest.emit (events.js:180:13)\n    at ClientRequest.onError (/home/.../node_modules/tunnel-agent/index.js:179:21)\n    at Object.onceWrapper (events.js:272:13)\n    at ClientRequest.emit (events.js:180:13)\n    at Socket.socketOnEnd (_http_client.js:429:9)\n    at Socket.emit (events.js:185:15)\n    at endReadableNT (_stream_readable.js:1106:12)\n    at process._tickCallback (internal/process/next_tick.js:178:19)"
url:"'....