title: Connecting to EC2 instance from Android phone
body: <p>I am trying to use EC2 to run a ruby server for an Android app. I have a physical Android phone running a Java app trying to connect to a ruby script running on my EC2 instance. I set it up with an Elastic IP which I am using in my Android app like so:</p>
  
  <pre><code>requestSocket = new Socket("53.244.196.69", 2000); // IP changed just in case
  </code></pre>
  
  <p>On the EC2 instance I am running the simple ruby script shown here:</p>
  
  <pre><code>server = TCPServer.open(2000)
  
  loop {
  client = server.accept
  client.puts(Time.now.ctime)
  client.puts "Closing the connection. Bye!"
  client.close
  }
  </code></pre>
  
  <p>As soon as I call the line of Java code above, it throws an exception saying that the connection was refused.</p>
  
  <p>I have the windows firewall disabled on my EC2 instance and I have the ports open in my security group so I am not sure what else could be the problem?</p>
  
  <p>Any help is very much appreciated as I am very new to cloud development. Thanks!</p>