dharmafly / noodle

A node server and module which allows for cross-domain page scraping on web documents with JSONP or POST.
https://noodle.dharmafly.com/
747 stars 69 forks source link

add in Proxy Support #100

Closed bryancolligan closed 9 years ago

bryancolligan commented 10 years ago

on line 120 of noodle.js add the following for proxy support:

if (query.proxy) { requestOptions.proxy = query.proxy; }

AaronAcerboni commented 9 years ago

Thanks 33db9154341f8307f90dec3ef61032dee2c5bbb6

mikeatlas commented 9 years ago

This breaks if noodle.fetch(url) doesn't specify a query (but the documentation shows examples that this could be done).

The workaround is to simply supply a query with every noodle.fetch call, but that's not so great.

I'll submit a PR fix for this, it should have checked if the query was passed at all first:

if (query && query.proxy) {
   requestOptions.proxy = query.proxy;
}
AaronAcerboni commented 9 years ago

Thank you @mikeatlas

mikeatlas commented 9 years ago

Ah, I'm about to submit my own PR for something else, might as fix this while I'm here :+1: