-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HTTP package] Pass unrecognized options through to request module #1703
Comments
The goal of the HTTP package is to provide a consistent interface between client and server, so adding lots of server-only options doesn't seem look a good idea. Maybe a specific option that's called "extraNodeRequestOptions" and documented as "We might change the backend to not be That said, if you want to do complex HTTP things that the Meteor http package doesn't implement, there's the workaround of just using |
I and others who've requested proxy support on SO would be happy to have an As for a consistent interface between client and server, the problem is similar to Minimongo vs. MongoDB. The latter has more options than the former, which is fantastic. Right now the client can't perform CORS requests for instance, while that's not a problem for the server. The client and server are just different. Why not empower the server to use proxies? Presumably the feature would be kept in the event that meteor would switch away from the |
For those who don't want to reinvent the wheel and use the low-level Npm https module, I've created a fork of Meteor's HTTP package called http-more. |
I'd like to have the possibility to use a proxy, especially if it's somehow possible to let the client side revert to proxy chaining, ( |
The package http-more is now available here. (Dan's url seems to redirect to a previous version of the package) |
Surely there must be a way to specify an outbound proxy server for meteor to use ? Meteor is useless in a corporate environment without that. Client side is handled automatically by the browser config so is transparent, but server has to explicitly configured somewhere. Industry standard http_proxy environment variable would be nice. |
I cannot believe that after more than a year after my #1664, this is still not fixed. Really crazy. It is really so hard to add some underscore prefixed options while we are waiting for "perfect" solution? |
@LeCoupa: http-more is available at https://github.com/dandv/meteor-http-more, can you please update the link in your comment or delete it (I've fixed mine above)? Thanks. I agree with @mitar and I'll be happy to retire my package in favor of Meteor's HTTP package simply passing along options it doesn't specifically recognize. |
In fact I need https://github.com/aldeed/meteor-http-extras. :-) I need to specify binary options. |
@mitar, I am biased but I have to agree. I put effort into making sure my PR (which is now the I think the issue is probably that MDG just doesn't see any need for an official http package anymore, so it won't be high priority. Our best bet is probably to combine all the features of |
The real world shows us that client apps are appearing on devices that were never considered when Meteor was first created, eg. watches, microwaves, cars, refrigerators etc. We cannot be expected to use Meteor across all of these. More server-side options to get at our data is greatly needed. |
As someone who has to deal with mostly non-english content, it outright sucks that i just can't set |
Feedback has been heard. We should make it much easier to use request directly via the HTTP module, with appropriate warnings that the API could change with updates. I hope to do this for 1.0.4 if time permits. |
You can use HTTPInternals.NpmModules.request.version to tell what version of request (if any) is the backend for HTTP.call. This version may change incompatibly from version to version of Meteor; use at your own risk. Fixes #1703.
Any example using npmRequestOptions? |
Nevermind, I found it: HTTP.post(url, {
npmRequestOptions: {
rejectUnauthorized: false // TODO remove when deploy
},
timeout: 30000, // 30s
data: xml
}, function(error, result) {
console.log('error: ' + error);
console.log('resultXml: ' + result);
}); |
The HTTP package calls request, which in turn calls Node's http or https modules. The latter especially can take rather esoteric options for TSL configuration.
It would be great if
HTTP.call()
would pass through any options it doesn't recognize. This solves a use case I ran into, where I had to set{rejectUnauthorized: false}
.The text was updated successfully, but these errors were encountered: