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

Use httpsAgent instead of httpAgent #5921

Open
perpil opened this issue Mar 19, 2024 · 2 comments
Open

Use httpsAgent instead of httpAgent #5921

perpil opened this issue Mar 19, 2024 · 2 comments
Assignees
Labels
documentation This is a problem with documentation. p2 This is a standard priority issue queued This issues is on the AWS team's backlog

Comments

@perpil
Copy link

perpil commented Mar 19, 2024

Describe the issue

In the example for how to turn off keep-alive on this page you use httpAgent. For DynamoDB and any AWS Service I can think of it should be httpsAgent. See httpOptions on this page for details.

Links

https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-reusing-connections.html
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/migrating/notable-changes/

@perpil perpil added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Mar 19, 2024
@perpil
Copy link
Author

perpil commented Mar 20, 2024

I should also mention, this requires importing Agent from https so the full snippet likely should be:

import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { NodeHttpHandler } from "@smithy/node-http-handler";
import { Agent } from "https";
const dynamodbClient = new DynamoDBClient({
    requestHandler: new NodeHttpHandler({
        httpsAgent: new Agent({ keepAlive: false })
    })
});

@RanVaknin RanVaknin self-assigned this Mar 20, 2024
@RanVaknin RanVaknin removed the needs-triage This issue or PR still needs to be triaged. label Mar 20, 2024
@RanVaknin
Copy link
Contributor

Hi @perpil,

Thanks again. Adding this to our backlog.

Ran~

@RanVaknin RanVaknin added p2 This is a standard priority issue queued This issues is on the AWS team's backlog labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. p2 This is a standard priority issue queued This issues is on the AWS team's backlog
Projects
None yet
Development

No branches or pull requests

2 participants