[英]Using custom cname for uploads with aws ios sdk
We're using the aws ios sdk to upload media to s3 but would like to use a different hostname (eg I'd like to cname up.ourdomain.com -> s3.amazonaws.com). 我们使用aws ios sdk将媒体上传到s3,但想使用不同的主机名(例如我想要cname up.ourdomain.com - > s3.amazonaws.com)。 Does anyone know if thats possible without too much hacking?
有没有人知道这是否可能没有太多的黑客攻击? I don't want it to be impossible to upgrade the sdk in the future.
我不希望将来升级sdk是不可能的。
Thanks! 谢谢!
I help maintain the AWS SDK for iOS. 我帮助维护适用于iOS的AWS开发工具包。 While I can't recommend that you proceed with this plan, you can set the endpoint on the service client like so:
虽然我不建议您继续执行此计划,但您可以在服务客户端上设置端点,如下所示:
s3 = [[AmazonS3Client alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY];
s3.endpoint = @"up.ourdomain.com";
While this should work with global operations (listing buckets for instance), the SDK will expect that BUCKETNAME.up.ourdomain.com
exists for any bucket you try to create or access directly. 虽然这应该适用于全局操作(例如列出存储桶),但SDK会期望您尝试创建或直接访问的任何存储桶都存在
BUCKETNAME.up.ourdomain.com
。 If you can guarantee that this will be the case then you may not run into any additional problems. 如果您能保证会出现这种情况,那么您可能不会遇到任何其他问题。
Can I ask why you feel the need to add an additional layer of indirection? 我可以问为什么你觉得需要添加一个额外的间接层?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.