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(MockHttpSocket): support keepalive (reused) sockets #560

Draft
wants to merge 70 commits into
base: main
Choose a base branch
from

Conversation

kettanaito
Copy link
Member

No description provided.

kettanaito and others added 24 commits March 11, 2024 14:20
@kettanaito kettanaito changed the base branch from main to feat/yet-another-socket-interceptor April 18, 2024 14:50
private customAgent?: http.RequestOptions['agent']
private onRequest: MockHttpSocketRequestCallback
private onResponse: MockHttpSocketResponseCallback
export function createHttpAgent(options: MockAgentOptions): http.Agent {
Copy link
Member Author

Choose a reason for hiding this comment

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

Mandatory change. Otherwise, we aren't respecting the options.customAgent enough (ignoring its keepalive, max sockets, etc.).

*/
this.responseStream?.push(null)
this.emit('end')
Copy link
Member Author

Choose a reason for hiding this comment

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

I have no idea what to do on the socket so it:

  1. Signals the ClientRequest that the response has ended.
  2. Stays alive.

@kettanaito kettanaito added the help wanted Extra attention is needed label Apr 18, 2024
Base automatically changed from feat/yet-another-socket-interceptor to main July 4, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants