Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29243

I am getting [SocketException: OS Error: Connection refused, errno = 111] when trying to access AWS EC2 server from my flutter app

$
0
0

I cannot connect to the REST API Server running on a AWS EC2 instance.

Below is the code snippet from the flutter application.

final EC2ServerPublicDNS = "http://ec2-*****.amazonaws.com";final awsSigV4Client = new AwsSigV4Client(        IAMUserAccessKey,        IAMUserSecretKey,        EC2ServerPublicDNS,        region: region);final signedRequest = new SigV4Request(      awsSigV4Client,      method: 'GET',      path: '/test',      headers:          new Map<String, String>.from({"Content-Type": "application/json"}),    );    http.Response response;    try {      response =          await http.get(signedRequest.url, headers: signedRequest.headers);    } catch (e) {      print(e);    }

I am getting:

[SocketException: OS Error: Connection refused, errno = 111, address = ec2-*****.amazonaws.com, port = 33278]


Viewing all articles
Browse latest Browse all 29243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>