Skip to content

Conversation

@deejayem
Copy link
Contributor

As described in #143, Alternator.js is currently broken for https endpoints for a couple of reasons, namely a hard-coded port number, and using the wrong agent object (http.Agent, instead of https.Agent).

This PR has three commits: one to fix each of those two issues, and one to use persistent http connections (passing { keepAlive: true } to the agent). To set the agent in init, I had to move some other code into there as well, otherwise it runs before agent is initialised.

With regards to the agent options, I would recommend also allowing the caller of init to pass their own options in (and then merge the two objects), but I didn't want to include too much in one PR.

I'm happy to squash, revert, or edit any parts of this (or to extend it with my extra options suggestion).

@deejayem deejayem force-pushed the javascript-fix-https branch from 3c93440 to c0db88a Compare September 18, 2025 09:08
@dkropachev
Copy link
Collaborator

@deejayem , can you please rebase

@deejayem
Copy link
Contributor Author

@deejayem , can you please rebase

@dkropachev sure. It looks as though your latest changes already solve two of the issues, but I can update this PR to just use persistent connections.

@deejayem deejayem force-pushed the javascript-fix-https branch from c0db88a to 17f9dc2 Compare September 30, 2025 16:02
@deejayem deejayem changed the title javascript: fix https connections javascript: use persistent http connections Sep 30, 2025
@deejayem
Copy link
Contributor Author

@dkropachev how does it look now?

I think we can already close #143 with your changes.

@dkropachev dkropachev merged commit 4f9844c into scylladb:master Sep 30, 2025
1 check passed
@dkropachev
Copy link
Collaborator

@deejayem , thanks David for your contribution

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.

2 participants