next-s3-upload
next-s3-upload copied to clipboard
Enable S3 IPv6 support
Added option to use IPv6 enabled dual-stack endpoints.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/dual-stack-endpoints.html#dual-stack-endpoints-description
Thanks for the PR!
Could you explain the bug that this PR fixes? I think using dualstack is fine, but it also changes the hostname of the uploaded file, which will potentially break existing users next/image configuration.
Just wanting a little more context around this before we make dualstack the default option.
I have a IPv6 only server that was failing to connect to the s3 endpoint as it was not IPv6 enabled.
You have a valid point regarding the next/image configuration and I think the best way to move forward is,
- Update the readme to handle the dualstack domains.
- Adding the dualstack endpoint as env variable.
- Set it to false by default now and set to true it at a later release.
Ok thanks! That makes a lot of sense.
I think it's best to let users opt into dual stack, similar how the S3 doesn't use dual stack by default but lets users opt in.
The easiest way to do this would be to change the uploadToS3
function to accept optional options. Something like...
uploadToS3(file, { useDualstack: true });
Let me know if you want to do this.
Oh also, I think it's a great idea to still add the dual stack domain to the README... this will make it easier for us switch it in the future if needed.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
next-s3-upload | ❌ Failed (Inspect) | Dec 20, 2022 at 6:50PM (UTC) |