我正在尝试使用fakes3 https://github.com/jubos/fake-s3作为我编写的一些简单 S3 代码的端点。但我无法超越连接阶段。
当前的错误是:NetworkingError: getaddrinfo ENOTFOUND
.
我有配置设置:
"aws": {
"accessKeyId": "123",
"secretAccessKey": "abc",
"region": "",
"endpoint": "http://localhost:8081",
"sslEnabled": false
}
var AWS = require('aws-sdk');
// loaded the config into an object called `config`:
AWS.config.update(config.aws);
s3 = new AWS.S3();
// also tried creating an `EndPoint`:
s3.endpoint = new AWS.Endpoint(config.aws.endpoint);
当我尝试简单的代码时,例如:
s3.putObject({ Bucket: 'logging', Key: "logging123", Body: "started" },
function(err, data) {
if (err) {
console.log(err);
}
});
出现上述错误。当我省略直接设置时endPoint
,请求向 AWS 东部区域发出(并忽略endpoint
我通过配置传入的值)。
而且,我正在跑步fakes3
使用命令行:
fakes3 -r c:\temp\_fakes3 -p 8081
Loading FakeS3 with c:/temp/_fakes3 on port 8081 with hostname s3.amazonaws.com
[2013-11-30 14:20:22] INFO WEBrick 1.3.1
[2013-11-30 14:20:22] INFO ruby 2.0.0 (2013-06-27) [x64-mingw32]
[2013-11-30 14:20:22] INFO WEBrick::HTTPServer#start: pid=11800 port=8081