title: Python socket timing out on other computer. TimeoutError: [WinError 10060]
body: <p>I'm trying to connect a client to server through python sockets. Clients connect successfully on my computer, but people on other networks cannot connect.</p>
  
  <p><code>TimeoutError: [WinError 10060]</code>
  on the client side after failing to connect. Here is the code for my python scripts.</p>
  
  <p>Server.py</p>
  
  <pre><code>import socket
  serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  host = "0.0.0.0"
  port = 8000
  print (host)
  print (port)
  serversocket.bind((host, port))
  </code></pre>
  
  <p>Client.py</p>
  
  <pre><code>import socket
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  host = "##.###.###.###" # server's public ip.
  port = 8001
  s.connect((host,port))
  print("Connected to server.")
  s.send(("Client connected").encode())
  </code></pre>
  
  <p>The ports are different because I can't connect without the local and external ports being different on my router; local being <code>8000</code> and external being <code>8001</code>. If the client is on my computer, the server reveals it's being connected to by the public ip, so it's passing through my router.</p>
  
  <p>Doing <code>nmap -p 8000 -sN -P0 192.168.0.#</code> on my server computer, reveals the port is closed using http-alt. Doing it on my public ip reveals that it's open|filtered using vcom-tunnel, but it's open|filtered on almost every port.</p>
  
  <p><strong>What I have tried:</strong></p>
  
  <ul>
  <li>Port forwarding with local_port=8000 and remote_port=8001. External ip set to my public ip, and my local ip set to my computer ip; 192.168.0.#</li>
  <li>Using DMZ Host (Exposed Host) on server-side router.</li>
  <li>Enabling and disabling UPNP, WAN Blocking, Ipsec PassThrough &amp; PPTP PassThrough separately on server-side router.</li>
  <li>Allowing TCP port <code>8000</code>, on local and remote through server-side firewall.</li>
  <li>Allowing program through firewall on public &amp; private networks on client and server.</li>
  <li>Allowing TCP port <code>8001</code>, on local and remote through client-side firewall.</li>
  <li>Binding client ip with <code>socket.bind((client_ip,port))</code> on client.py</li>
  </ul>
  
  <p>It might be the port I'm using having to do with <code>http-alt</code>/<code>vcom-tunnel</code>, instead of one with upnp.</p>