title: How to connect with Python Sockets to another computer on the same network
body: <p>So I was trying to figure out a way to use sockets to make a terminal-based chat application, and I managed to do it quite well. Because I could only test it on one computer, I didn't realize that it might not work on different computers. My code is as simple as this:</p>
  <pre class="lang-py prettyprint-override"><code># Server
  import socket
  HOST = &quot;0.0.0.0&quot;
  PORT = 5555
  
  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
      s.bind((HOST, PORT))
      s.listen()
      while True:
          conn, addr = s.accept()
          with conn:
              print(&quot;Connected to&quot;, addr)
              data = conn.recv(1024)
              print(&quot;Received:&quot;, data.decode())
              conn.sendall(data)
  </code></pre>
  <pre class="lang-py prettyprint-override"><code># Client
  import socket
  HOST = &quot;192.168.0.14&quot;
  PORT = 5555
  
  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
      s.connect((HOST, PORT))
      s.sendall(b&quot;Hello this is a connection&quot;)
      data = s.recv(1024)
  print(&quot;Received:&quot;, data.decode())
  </code></pre>
  <p>I've tried changing the ip to 0.0.0.0, use gethostname a lot of other things, but it just doesn't work. The server is up and running, but the client can't connect. Can someone help me?</p>