-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Michael Solomon <[email protected]>
…541) Co-authored-by: Michael Solomon <[email protected]>
Co-authored-by: Artem Zakharchenko <[email protected]>
private customAgent?: http.RequestOptions['agent'] | ||
private onRequest: MockHttpSocketRequestCallback | ||
private onResponse: MockHttpSocketResponseCallback | ||
export function createHttpAgent(options: MockAgentOptions): http.Agent { |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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:
- Signals the ClientRequest that the response has ended.
- Stays alive.
No description provided.