Dan Dascalescu
Dan Dascalescu

Reputation: 152056

How can I force a meteor app to make all HTTP calls through a proxy?

I'm trying to emulate curl through a proxy server. The meteor docs don't mention any proxy settings for HTTP.* methods.

Is there a meteor-specific solution? Right now I'm using ProxyChains.

Ideally I'd use a SOCKS proxy and only HTTP.* calls would go through it, but I'm open to all calls from the application going through any type of proxy.

Upvotes: 5

Views: 1352

Answers (2)

Dan Dascalescu
Dan Dascalescu

Reputation: 152056

Meteor 1.1 update

You can pass options directly to the npm request module via the npmRequestOptions parameter to HTTP.*. The functionality was enabled by this commit made after I filed an issue in 2013 (see below).

You no longer need to use the http-more package.

Old answer, pre-Meteor 1.1

One method would be pass a proxy parameter to HTTP.* calls, which use the request module, which supports proxies as an option.

proxy isn't a recognized option in the HTTP package, and I've filed a request to simply pass through unrecognized options. It was rejected by one of the Meteor core developers.

I'd rather people vote on that issue, asking for unknown options to be passed through instead of being ignored. In the meantime, I've created a package that does pass through options: http-more.

Upvotes: 5

mjkaufer
mjkaufer

Reputation: 4206

Here's a Meteor proxy package: https://npmjs.org/package/seafish-http-proxy-meteor

It's not available through atmosphere, but it is an npm package designed for meteor, which means it will be very easy to integrate.

Upvotes: 1

Related Questions