{
  "id": 11226931,
  "title": "Simple TCP Client in Python",
  "url": "https://urgent.news/2026/10/01/simple-tcp-client-in-python",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-01T16:00:12.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/raghavvram_johnson/simple-tcp-client-in-python-1k8"
  },
  "original_language": "en",
  "account": "This article provides instructions for creating a basic TCP client using Python's built-in socket library. The need for this simple TCP client arises from the fact that many industry servers lack tools like curl or wget, and network access is often restricted, making package management downloads impossible. However, Python is almost always available, so we aim to build a TCP client without any additional libraries.\n\nTo begin, we import the socket module and define the target host (www.google.com) and target port (80). We then create a socket object with the AF_INET and SOCK_STREAM parameters. AF_INET represents a standard IPv4 address or hostname, while SOCK_STREAM indicates that this connection will be a TCP client. Following this, we establish a connection with the server and send some data to it.\n\nThe final step involves receiving the server's response and printing it out. This represents the simplest form of a TCP client, although it is a common task in programming. However, there are some assumptions made in this example that should be noted. Firstly, we assume that the connection will always be successful, and secondly, we assume that the server is always prepared to receive data from us. Our third assumption is that the server will respond to our requests promptly.\n\nThese assumptions are made primarily for simplicity's sake. While there is debate among programmers about how to handle blocking sockets, exception-handling in sockets, and similar issues, it is uncommon for pentesters to incorporate such niceties into quick-and-dirty tools used for reconnaissance or exploitation work. As such, these considerations are omitted in this guide.",
  "summary": "This is a guide to write a quick simple TCP client in pure python. First of all, why would anyone need this ? Industry Servers dosent have tools like curl or wget, and most of the time have restricted network access, so downloading using the package manager isn't possible too. But most if not all of the time, you can find a version of python installed. So we will try to make a TCP client without…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}