Comments (6)
Hi.
Can you post a code sample of what you are trying to accomplish?
from node-libcurl.
i've took the proxies from http://proxylist.hidemyass.com/
'use strict';
var Curl = require('node-libcurl').Curl;
var opts = {
headers: {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36'
}
};
// this works https + socks5
// opts.url = 'https://www.yahoo.com';
// opts.proxy = 'socks5h://46.4.88.203:9050';
// this doesn't work. https + proxy. i get a timeout. on this proxy or any other http proxy
opts.url = 'https://www.yahoo.com';
opts.proxy = '220.255.3.170:80';
// but this works. http + proxy
// opts.url = 'http://www.yahoo.com';
// opts.proxy = '220.255.3.170:80';
var curl = new Curl();
var curlOpts = {};
curlOpts['CUSTOMREQUEST'] = 'GET';
curlOpts['URL'] = opts.url;
curlOpts['CONNECTTIMEOUT_MS'] = 30000;
curlOpts['FOLLOWLOCATION'] = false;
curlOpts['ACCEPT_ENCODING'] = 'gzip';
curlOpts['PROXY'] = opts.proxy;
curlOpts['HTTPHEADER'] = [];
for (let key in opts.headers) {
curlOpts['HTTPHEADER'].push(key + ': ' + opts.headers[key]);
}
for (let key in curlOpts) {
curl.setOpt(Curl.option[key], curlOpts[key]);
}
curl.on('end', function (statusCode, body, headers) {
console.log(statusCode, headers);
curl.close();
});
curl.on('error', function(err, errCode) {
console.error(err);
curl.close();
});
curl.perform();
from node-libcurl.
Still investigating this, but already exhausted the time I had this week, gonna debug more next week.
From what I can see the socket is closed before the connection is made. I'm trying to understand what is going on.
from node-libcurl.
Ok, looks like the issue was with libcurl itself, it was probably because of this bug http://sourceforge.net/p/curl/bugs/1492/, fixed here curl/curl@852d35b6ea.
If you are wondering why it doesn't happens when using the curl tool, it's probably because the tool itself doesn't uses the multi interface, while this binding does.
Try using a version of libcurl > 7.42
from node-libcurl.
thank you :)
from node-libcurl.
I just comment to explain the code using port 80 proxy mean http proxy, not https proxy (port 443)
So the proxy server will not accept https method. Am i right?
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.