Comments (7)
- Have you implemented NTLM authentication for exchange in this project?
I didn't not tested NTLM auth, it should work the way it's. Take a look into the HTTPAUTH option, the CURLAUTH_*
constants are mapped to Curl.auth.*
in this binding. Remember that you need a libcurl that was built with OpenSSL or GnuTLS for it to work.
When i am trying to use setOpt as below i am getting error. However it's mentioned here - http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
You need to be more clear on what error it's throwing, but from the code that you posted:
curl.setOpt('ACCEPT_ENCODING', 1);
ACCEPT_ENCONDING
must be a string, you are passing a number.
Also, your tittle mentions an error that is not on your description, did you fixed it?
from node-libcurl.
Hi
Thanks for your help. Actually i resolved the title error :). But whenever i am trying to use setOpt for the following examples-
curl.setOpt(Curl.option.SSLVERSION, 3);
curl.setOpt(Curl.option.IPRESOLVE, 1); // CURL_IPRESOLVE_V4
I am getting the follwing error-
"Error: Unknown option given. First argument must be the option internal id or the option name. You can use the Curl.option constants.
at Error (native)
at Curl.setOpt (/home/mz/mz-node-modules/node_modules_base/node_modules/node-libcurl/lib/Curl.js:529:23)"
Also when i am doing curl.setOpt(Curl.option.ACCEPT_ENCODING, 'true'), it's working but
Is it actually setting the ACCEPT_ENCODING to true?
from node-libcurl.
Error: Unknown option given. First argument must be the option internal id or the option name. You can use the Curl.option constants.
You are using SSLVERSION
, this option was not added yet. I've just published a new version to npm with it, try version 0.6.2
.
Also, don't use numbers directly, since this is error prone. Use the constants:
curl.setOpt(Curl.option.SSLVERSION, Curl.sslversion.SSLv3 );
curl.setOpt(Curl.option.IPRESOLVE, Curl.ipresolve.V4 );
Also when i am doing curl.setOpt(Curl.option.ACCEPT_ENCODING, 'true'), it's working but
Is it actually setting the ACCEPT_ENCODING to true?
Yes, which is wrong. You must pass the encoding that you expect: CURLOPT_ACCEPT_ENCONDING
Sets the contents of the Accept-Encoding: header sent in a HTTP request, and enables decoding of a response when a Content-Encoding: header is received. Three encodings are supported: identity, which does nothing, deflate which requests the server to compress its response using the zlib algorithm, and gzip which requests the gzip algorithm.
If a zero-length string is set like "", then an Accept-Encoding: header containing all built-in supported encodings is sent.
You can also opt to just include the Accept-Encoding: header in your request with CURLOPT_HTTPHEADER but then there will be no automatic decompressing when receiving data.
This is a request, not an order; the server may or may not do it. This option must be set (to any non-NULL value) or else any unsolicited encoding done by the server is ignored. See the special file lib/README.encoding for further details.
from node-libcurl.
Hi,
Thanks again for your help. I checked console.log(Curl.option) and found that IPRESOLVE isn't present in Curl.option. However it's mentioned here http://curl.haxx.se/libcurl/c/CURLOPT_IPRESOLVE.html . I also checked console.log(Curl.ipresolve) and found that Curl.ipresolve has all the three possible values. So i concluded that IPRESOLVE isn't present in Curl.option however its corresponding values are present in Curl.ipresolve. Not sure but 'IPRESOLVE' might be missing from Curl.cc
Currently i am getting error on
curl.setOpt(Curl.option.IPRESOLVE, Curl.ipresolve.V4);
and the error is
"/home/mz/mz-node-modules/node_modules_base/node_modules/node-libcurl/lib/Curl.js:847
or the option name. You can use the Curl.option constants.' : Easy.strError(
^
Error: Unknown option given. First argument must be the option internal id or the option name. You can use the Curl.option constants.
at Error (native)
at Curl.setOpt (/home/mz/mz-node-modules/node_modules_base/node_modules/node-libcurl/lib/Curl.js:847:190)
at Object. (/home/mz/mz/programs/dragon/repo/releases/20151001074739/src/test/imap_smtp_connect_check/node-libcurl-test-2.js:23:6)"
from node-libcurl.
Sorry, forgot again to add this one. It should work now! 😅
Try v0.6.3
from node-libcurl.
Thanks a lot for your help. Now everything is working fine my side. One last thing. For one exchange account i set 'HTTPAUTH' as NTLM (8) and it failed then i tried with BASIC(1) and it worked. I was using 9 for NTLM or BASIC authentication in node-curl. Can i use it for node-libcurl also?
Also i am closing curl in our code in on 'end' and on 'error' as below.
var Curl = require('node-libcurl').Curl;
var _curl = new Curl();
_curl.close();
// Error: "Cannot read property 'close' of undefined".
and also what is this.close() means in your example code.
from node-libcurl.
In reality those values are bitmasks, if you want to try more than one auth method, you should OR them together, like this:
curl.setOpt( 'HTTPAUTH', Curl.auth.BASIC | Curl.auth.NTLM );
Note the |
(bitwise OR) operator.
Closing this as it's resolved, feel free to ask any questions if you have.
from node-libcurl.
Related Issues (20)
- How can I write a custom request asynchronously? HOT 1
- [feat] rewrite `node-libcurl` with, the **ONLY** isomorphic way, napi HOT 1
- Curl Easy segmentation fault with requests to external site HOT 3
- Expected npx node-libcurl $URL to work as curl $URL HOT 1
- TypeError: Class extends value #<Object> is not a constructor or null HOT 1
- HTTP_CONTENT_DECODING = false but still decodes the server's responses HOT 1
- How to make multiple curly instances maintain separate connections to same host? HOT 2
- unable to npm install HOT 3
- npm install issues. HOT 5
- libcurl vuln HOT 2
- Add prebuilt binaries for nodejs 20 LTS HOT 13
- read raw msg HOT 3
- Does node-libcurl support res_init? HOT 1
- Error after upgrade to Node 20.10 ...: ERR_DLOPEN_FAILED HOT 2
- SFTP / SSH stuck on login when using Curl/Multi and password auth HOT 2
- Curly - Close connection - Timeout Exception HOT 3
- Cannot install HOT 3
- Send binary data with HTTPPOST option HOT 1
- Hanging on PROTOCONNECTING
- Add prebuilt binaries for node 21(macOS) HOT 1
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-libcurl.