Amazon S3:与服务器的套接字连接在超时期限内未读取或写入
我正在使用s3软件包将file upload到S3: https : //www.npmjs.com/package/s3 。 我写了下面的代码(基于代码示例):
var s3 = require('s3'); var client = s3.createClient({ maxAsyncS3: 20, // this is the default s3RetryCount: 3, // this is the default s3RetryDelay: 1000, // this is the default multipartUploadThreshold: 20971520, // this is the default (20 MB) multipartUploadSize: 15728640, // this is the default (15 MB) s3Options: { accessKeyId: *****, secretAccessKey: ******, // any other options are passed to new AWS.S3() // See: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#constructor-property }, }); var params = { localFile: "*****", s3Params: { Bucket: "*****", Key: "*****", // other options supported by putObject, except Body and ContentLength. // See: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#putObject-property }, }; var uploader = client.uploadFile(params); uploader.on('error', function(err) { console.error("unable to upload:", err.stack); }); uploader.on('progress', function() { console.log("progress", uploader.progressMd5Amount, uploader.progressAmount, uploader.progressTotal); }); uploader.on('end', function() { console.log("done uploading"); });
我得到了以下错误:
无法上传:RequestTimeout:您的套接字连接到服务器没有读取或写入超时期限内。 空闲连接将被closures。
你有什么想法如何解决这个问题?
我也检查了这个链接: amazon s3上传文件超时了 ,并没有帮我解决问题。
- 如何从heroku上的NodeJS应用程序删除socket.io轮询日志?
- 我怎么知道,Stream使用的是什么本地端口?
- Sails.js + socket.io:从服务器发送消息到客户端
- 使用Angular.js和Node.js构build实时应用程序的更好方法是什么?
- NodeJs:读取TCP套接字时永远不会发出“结束”
- socket.io – 发送到socketid(单个客户端)不起作用
- 带有express的socket.io中的SSL:缺lessPFX或证书+私钥。
- 在socket.io中使用restify时,'headers already sent'错误
- Node.js设置setKeepAlive不停止与setTimeout超时