如何将本地主机设置为Amazon SNS服务的主题订阅的端点?

huangapple go评论94阅读模式
英文:

How to set localhost as endpoint of a topic subscription - Amazon sns service

问题

我需要在本地主机上实现Amazon SNS服务,以测试一个Go应用程序,但当我尝试将我的本地主机设置为主题订阅的终端时,显示错误:

无权订阅内部终端(服务:AmazonSNS;状态码:403;错误代码:AuthorizationError;请求ID:14bc8224-4b0d-5b9a-a61c-d24122fdf703)

这是可能的吗?我对此不太了解。

英文:

I need to implement amazon sns service in my localhost to test an Go Application but when i tried to set my localhost as Topic subscription's Endpoint it shows Error:

Not authorized to subscribe internal endpoints (Service: AmazonSNS; Status Code: 403; Error Code: AuthorizationError; Request ID: 14bc8224-4b0d-5b9a-a61c-d24122fdf703)

is it Possible?I am new to this

答案1

得分: 3

现在,这真的是一个很旧的帖子。但是最近我尝试了类似的东西,使用了ngrok服务。https://ngrok.com/

这个服务为你的本地主机分配一个临时的端点,而且这个端点可以完全从公共互联网解析。

例如,如果你在8080端口上运行一个HTTP服务器,你可以使用命令"ngrok HTTP 8080"启动ngrok(当然,这需要下载ngrok桌面二进制文件并将其设置在路径变量中)。但是一旦你运行这个命令,所有流量都会被重定向到临时的ngrok端点,然后转发到你的本地服务。

类似这样:

http://c5fdddc8.ngrok.io -> http://localhost:8080

你可以订阅AWS SNS主题中的ngrok端点,它会将HTTP请求重定向到运行在你的本地主机上的服务。

英文:

Now, this is really an old post. But I tried something similar recently using the ngrok service. https://ngrok.com/

This service assigns a temporary endpoint to your localhost and this endpoint is completely resolvable from the public internet.

For example if you are running an HTTP server at port 8080, you can start the ngrok with the command "ngrok HTTP 8080" (of course this requires that ngrok desktop binary is download and set in the path variable). But once you run this command, every traffic which is coming to the temporary ngrok endpoint is redirected to your local service.

Something like this:

http://c5fdddc8.ngrok.io -> http://localhost:8080

You can subscribe to the ngrok endpoint in the AWS sns topic and it will redirect the HTTP request to the service running in your localhost.

答案2

得分: 2

我猜你是指一个HTTP/S端点?SNS是由亚马逊运行的,所以localhost指向他们的服务器。你需要使你的端点能够从互联网访问。请参考这里的第一步:http://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.html#SendMessageToHttp.subscribe

英文:

I guess you mean an HTTP/S endpoint? SNS is run by Amazon, so localhost points to their server. You will need to make your endpoint accessible from the internet. Please see Step 1 here: http://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.html#SendMessageToHttp.subscribe

huangapple
  • 本文由 发表于 2016年9月28日 15:47:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/39741159.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定