question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `createConnection` option for http or https requests

See original GitHub issue

Hi, I need a possibility of using createConnection option in the http/https request:

createConnection <Function> A function that produces a socket/stream to use for the request when the agent option is not used. This can be used to avoid creating a custom Agent class just to override the default createConnection function. See agent.createConnection() for more details. Any Duplex stream is a valid return value.

You can read more info about this function in the Node.js documentation: https://nodejs.org/api/http.html#http_http_request_options_callback

NOTE: The createConnection of globalAgent isn’t suitable for me because I use other connections

P.S. Thanks for your work and the best library for EventSource.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
thedillonbcommented, Sep 5, 2019

This would be extremely helpful as there doesn’t currently seem to be a way to use UNIX domain sockets with this library.

0reactions
thedillonbcommented, Oct 2, 2019

Can we get a ruling on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

createConnection option not work for https module #24543
I thinks it's because net.createConnection() and port 80 use HTTP, not HTTPS. The HTTPS agent's createConnection() is built around tls.connect() ...
Read more >
Node.js: Relationship among http.Server, http.Agent, sockets ...
The function agent.createConnection() is used when you want to avoid creating a custom agent as well as http.globalAgent . This function ...
Read more >
HTTP | Node.js v19.3.0 Documentation
Class: http.Agent # · new Agent([options]) · agent.createConnection(options[, callback]) · agent.keepSocketAlive(socket) · agent.reuseSocket(socket, request) · agent ...
Read more >
Manage connections in Azure Functions - Microsoft Learn
Among those shared resources are connections: HTTP connections, ... scale controller adds function app instances to handle more requests, ...
Read more >
Using the Node.js Driver - Snowflake Documentation
createConnection to create a new Connection object, and pass in a JavaScript object that ... Use this property to specify the HTTP protocol:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found