title: Amazon web services: server-client connection with local machine using python socket ip address setting
body: <p>I have started using amazon web services for creating server. I need to communicate my local machine with aws server. </p>
  
  <p>What ip-address should I set in the following python scripts.</p>
  
  <p>Server side:</p>
  
  <pre><code>import socket
  def server_program():
      # get the hostname
      host = "172.17.130.197"
      port = 5588
      server_socket = socket.socket()      
      server_socket.bind((host, port)) 
      server_socket.listen(2)
      conn, address = server_socket.accept()  # accept new connection
      print("Connection from: " + str(address))
      while True:       
           data = conn.recv(1024).decode()
           print("from connected user: " + str(data))
           d=str(data)
           data = d.upper()
           conn.send(data.encode())  # send data to the client
  
  conn.close()  # close the connection
  
  if __name__ == '__main__':
       server_program()
  </code></pre>
  
  <p>Client side:</p>
  
  <p>import socket</p>
  
  <pre><code>def Main():
      host = "172.17.130.197"
      port = 5590
  
      mySocket = socket.socket()
      mySocket.connect((host,port))
  
      message = input(" -&gt; ")
  
      while message != 'q':
          mySocket.send(message.encode())
          data = mySocket.recv(1024).decode()
  
          print ('Received from server: ' + data)
  
          message = input(" -&gt; ")
  
      mySocket.close()
  
  if __name__ == '__main__':
      Main()
  </code></pre>
  
  <p>Please help, thanks in advance.</p>