JCMais / node-libcurl

libcurl bindings for Node.js
https://npmjs.org/package/node-libcurl
MIT License
666 stars 118 forks source link

Hanging on PROTOCONNECTING #408

Open rprovodenko opened 7 months ago

rprovodenko commented 7 months ago

Describe the bug

await curly.get("https://www.baidu.com/s?wd=Russia", {
    verbose: true,
  });

Hangs forever. Logs:

* STATE: INIT => CONNECT handle 0x7f9cd404b808; line 1879 (connection #-5000)
* Added connection 0. The cache now contains 1 members
* STATE: CONNECT => RESOLVING handle 0x7f9cd404b808; line 1925 (connection #0)
* family0 == v4, family1 == v6
*   Trying 103.235.47.103:443...
* STATE: RESOLVING => CONNECTING handle 0x7f9cd404b808; line 2009 (connection #0)
* Connected to www.baidu.com (103.235.47.103) port 443 (#0)
* STATE: CONNECTING => PROTOCONNECT handle 0x7f9cd404b808; line 2074 (connection #0)
* ALPN: offers h2
* ALPN: offers http/1.1
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* Didn't find Session ID in cache for host HTTPS://www.baidu.com:443
* STATE: PROTOCONNECT => PROTOCONNECTING handle 0x7f9cd404b808; line 2092 (connection #0)
node -e "console.log(require('node-libcurl').Curl.getVersionInfoString())"
Version: libcurl/7.86.0 OpenSSL/3.0.12 zlib/1.2.13 brotli/1.0.9 zstd/1.4.9 libidn2/2.1.1 libssh2/1.10.0 nghttp2/1.58.0
Protocols: dict, file, ftp, ftps, gopher, gophers, http, https, imap, imaps, ldap, ldaps, mqtt, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Features: AsynchDNS, Debug, TrackMemory, IPv6, Largefile, NTLM, NTLM_WB, SSL, libz, brotli, TLS-SRP, HTTP2, UnixSockets, HTTPS-proxy, alt-svc

OS: Latest MacOS - Intel, Ubuntu - Intel Node.js Version: 18 + 20 node-libcurl versions: 4.0.0 and 3.0.1-0

This seems to be some kind of internal libcurl issue which maybe have been fixed (libcurl/7.86.0 is around 4 years old as you know). I'm passing the exact same arguments to a current version of curl installed on my computer and it's working just fine.

Also tried this just in case, didn't help: https://github.com/JCMais/node-libcurl/blob/develop/COMMON_ISSUES.md