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

fix(ext/node): support createConnection option in node:http.request() #25470

Open
wants to merge 99 commits into
base: main
Choose a base branch
from

Conversation

satyarohith
Copy link
Member

@satyarohith satyarohith commented Sep 5, 2024

Work in progress. Feature works but breaks existing tests.

Closes #19507

@kt3k kt3k added the ci-draft Run the CI on draft PRs. label Sep 26, 2024
@kt3k kt3k changed the title WIP: support createConnection option in node:http.request() fix(ext/node): WIP support createConnection option in node:http.request() Sep 26, 2024
@kt3k kt3k requested a review from bartlomieju October 25, 2024 07:25
Signed-off-by: Satya Rohith <me@satyarohith.com>
Signed-off-by: Satya Rohith <me@satyarohith.com>
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass review. Amazing work 🚀

ext/node/ops/http.rs Outdated Show resolved Hide resolved
where
P: crate::NodePermissions + 'static,
{
let client = if let Some(rid) = client_rid {
let r = state
let (_handle, mut sender) = if encrypted {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not confident we should forget the handle to the spawned task - the errors raised from the task will not be handled and they should probably be piped back. I can't think of a particular scenario at the moment though

ext/node/ops/http.rs Outdated Show resolved Hide resolved
ext/node/ops/http.rs Outdated Show resolved Hide resolved
ext/node/ops/http.rs Outdated Show resolved Hide resolved
ext/node/polyfills/internal_binding/tcp_wrap.ts Outdated Show resolved Hide resolved
ext/node/polyfills/net.ts Show resolved Hide resolved
Comment on lines 1006 to 1007
// TODO(kt3k): This should be "localhost" when we implemented happy-eyeballs for node:net
const request = http.request("http://127.0.0.1:5929/");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will all these changes cause regressions in already working libraries? Should we implement happy-eyeballs first?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we implement happy-eyeballs first?

I guess that is safer.

@cobbvanth
Copy link

Can we get this merged asap, it fixes vital issues with many libraries!

@kt3k
Copy link
Member

kt3k commented Oct 29, 2024

I guess this workaround (stopping startTls in afterConnect in tls.connect) is still necessary. ref: 8e55dab

I'll trying restore that workaround and see if it fixes node-gyp issue. nevermind

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

Successfully merging this pull request may close these issues.

node: ClientRequest.options.createConnection
5 participants