Comments (11)
Hi
First of all many thanks for your support words, they're very kind ;)
I think I've an easy solution to your problem and most important - at least to me - that won't break compatibility with previous node-rest-client versions.
I'll try to apply it in the next few days (probably on next monday it will be ready), keep an eye.
from node-rest-client.
Hi as you can see it has not been fixed "on next monday".... :(
I'll try to fix it asap
sorry for the delay.
from node-rest-client.
No need to sorry, thanks :)
Actually I can help fix it and send you a pull request if you don't mind
from node-rest-client.
I'm already fixing the issue, but of course you can do a pull request whenever you want. Surely it will help me.
just one question, the request that works and you mention in your previous comment was done directly with http client for node.js and not using node-rest-client?
Thanks
from node-rest-client.
Well I think I've fix it. As you can see in the new version of the docs there's a new parameter in proxy options "tunnel:true | false". So if you want to use direct request to proxy instead of tunneling you must instantiate the client with "tunnel:false" (to maintain backward compatibility I couldn't set direct request to proxy as default proxy connection method)
var RestClient = require('node-rest-client').Client,
client = new RestClient({
proxy:{
host:"proxyDomain",
port: 8080,
user:"username",
password:"password",
tunnel:false // use direct request to proxy
}
});
client.registerMethod("jsonMethod", "http://ogcef.one.gov.hk/event-psi/json/calendar/20140215.json", "GET");
client.methods.jsonMethod(function (data, response) {...});
I've tested and for me it's working, please let me know whether it works for you too.
Bye
from node-rest-client.
Thanks. It works like a charm. :)
Would you please release it to NPM repository also? Thanks a lot.
from node-rest-client.
That's what I'm trying since yesterday, but I'm having unexpected authentication problems with npm registry (?!??).
Hope that it'll be fixed soon
from node-rest-client.
I've had to reinstall node and npm and now everything seems to work again, but please if you don't mind let me know whether it works for you.
Thanks.
from node-rest-client.
Hey guys, thanks so much for this module - it's made my first forray into Node a lot easier.
But, I was running 0.7.7 and I happened to be combining projects and ran npm install in a new directory, and got version 0.7.9 (had "node-rest-client" : "~0.7.7"), and I noticed the commit associated with this issue.
And I got this error:
$ nodemon server.js
21 Feb 14:50:44 - [nodemon] v1.0.15
21 Feb 14:50:44 - [nodemon] to restart at any time, enter `rs`
21 Feb 14:50:44 - [nodemon] watching: *.*
21 Feb 14:50:44 - [nodemon] starting `node server.js`
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
...live/node_modules/node-rest-client/lib/node-rest-client.js:14
self.useProxyTunnel = self.options.proxy.tunnel===undefined?true:self.options
^
TypeError: Cannot read property 'tunnel' of undefined
at new exports.Client (.../live/node_modules/node-rest-client/lib/node-rest-client.js:14:42)
at Object.<anonymous> (.../live/server/routes.js:10:10)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (.../live/server.js:39:1)
at Module._compile (module.js:456:26)
21 Feb 14:50:52 - [nodemon] app crashed - waiting for file changes before starting...
I reverted to 0.7.7 and it worked.
server.js:39 is:
require('./server/routes.js')(app, passport);
routes.js:10 is the client = line below:
var passport = require('passport'),
Client = require('node-rest-client').Client;
var host = "https://my.host";
var options_auth = {user : "my-user",
password: "my-pw"
};
client = new Client(options_auth);
Hopefully this is helpful.
Thanks.
from node-rest-client.
Yes, direct proxy connection works for me. Thanks.
from node-rest-client.
Hello @aacerox ,
I know its been a long time since this issue was fixes but I am still facing issue. The client is unable to complete the request when inside a proxy. The SSL hand shake fails to connect to the server. below is my set up for the proxy
options_proxy = { proxy: { host: "<My ip>", port: 8888, tunnel: true } }; globalproxySet = true; client = new Client(options_proxy);
I have the client response as follows after the set up
EventEmitter { options: { proxy: { host: '<my local IP>', port: 8888, tunnel: true } }, useProxy: true, useProxyTunnel: true, proxy: { host: '<My IP>', port: 8888, tunnel: true }, connection: {}, mimetypes: {}, requestConfig: {}, responseConfig: {}, methods: {}, parsers: { add: [Function], remove: [Function], find: [Function], getAll: [Function], getDefault: [Function], clean: [Function] }, serializers: { add: [Function], remove: [Function], find: [Function], getAll: [Function], getDefault: [Function], clean: [Function] }, get: [Function], post: [Function], put: [Function], delete: [Function], patch: [Function], registerMethod: [Function], unregisterMethod: [Function], addCustomHttpMethod: [Function] }
I am using Charles for proxy settings. Please let me know what am I doing wrong.
from node-rest-client.
Related Issues (20)
- Vulernability in debug-2.2.0
- promise from http calls HOT 2
- TLS 1.2 Support HOT 1
- Support for retry HOT 1
- Cannot get examples to work HOT 2
- Handle JSON Hijacking prevention HOT 1
- xmlSerializer is not defined
- NPM Vulnerability HOT 2
- Problem behind a Proxy with Tunnel HOT 4
- Can I send a binary file with this?
- "node_modules\node-rest-client\lib\nrc-serializer-manager.js:122" HOT 1
- Result is not defined in nrc-parser-manager HOT 1
- Use a loop? HOT 1
- HTTPS: unable to verify the first certificate error HOT 2
- https encryption
- Content-Type header is case sensitive
- Cannot send multipart/form-data
- The git repository has been abandoned
- "Error: socket hang up" when using node-rest-client if follow-redirects Ver > 1.13.3 HOT 1
- Replace xml2js due to CVE-2023-0842
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-rest-client.