Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add createConnection option for http or https requests #119

Open
xv2 opened this issue Mar 13, 2019 · 6 comments
Open

Add createConnection option for http or https requests #119

xv2 opened this issue Mar 13, 2019 · 6 comments

Comments

@xv2
Copy link
Contributor

xv2 commented Mar 13, 2019

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

createConnection 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.

@aslakhellesoy
Copy link
Contributor

Is this functionality in the spec? If not, why do you think we should deviate from the spec?

@xv2
Copy link
Contributor Author

xv2 commented Sep 1, 2019

Of course this option isn't in EventSource specification. This option (createConnection) is only for Node.js® as other your options (in your code): proxy, rejectUnauthorized ...

@aslakhellesoy
Copy link
Contributor

I suppose we could add it as a non-standard property on the eventSourceInitDict object. Any objections from anyone?

@xv2 send a pull request and we can discuss it.

@xv2
Copy link
Contributor Author

xv2 commented Sep 2, 2019

@aslakhellesoy PR: #120

@thedillonb
Copy link

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

@thedillonb
Copy link

Can we get a ruling on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants