<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/setting-up-a-tcp-listener-and-connecting-to-it-with-netcat-elnnrnwsw" -->

---
title: Setting Up a TCP Listener and Connecting to It with Netcat
description: Learn how to set up a TCP listener and connect to it using Netcat. Discover the different variants of Netcat, how to listen for incoming connections, and what...
canonical: https://daily.dev/posts/setting-up-a-tcp-listener-and-connecting-to-it-with-netcat-elnnrnwsw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Setting Up a TCP Listener and Connecting to It with Netcat | daily.dev
og:description: Learn how to set up a TCP listener and connect to it using Netcat. Discover the different variants of Netcat, how to listen for incoming connections, and what...
og:url: https://daily.dev/posts/setting-up-a-tcp-listener-and-connecting-to-it-with-netcat-elnnrnwsw
og:image: https://api.daily.dev/og/posts/eLNNrnwsw.png
og:image:alt: Setting Up a TCP Listener and Connecting to It with Netcat
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting Up a TCP Listener and Connecting to It with Netcat

**[Nick Janetakis](https://daily.dev/sources/nickjanetakis)** · 4 min read · 8 upvotes · 1 comments

## Summary

Learn how to set up a TCP listener and connect to it using Netcat. Discover the different variants of Netcat, how to listen for incoming connections, and what happens when you try to listen on the same port twice.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nickjanetakis.com/blog/setting-up-a-tcp-listener-with-connecting-to-it-with-netcat>

## Community discussion

Top comments from developers on daily.dev.

**@crs1138** · 0 upvotes

> Great article, but could anyone elaborate on why would I want to connect to an IP/port? In what scenario is that useful? Pls, forgive me my ignorance.

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#openbsd](https://daily.dev/tags/openbsd), [#testing](https://daily.dev/tags/testing)

[View this post on daily.dev](https://daily.dev/posts/setting-up-a-tcp-listener-and-connecting-to-it-with-netcat-elnnrnwsw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Setting Up a TCP Listener and Connecting to It with Netcat","url":"https://daily.dev/posts/setting-up-a-tcp-listener-and-connecting-to-it-with-netcat-elnnrnwsw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/setting-up-a-tcp-listener-and-connecting-to-it-with-netcat-elnnrnwsw"},"datePublished":"2024-04-09T10:27:12.452Z","dateModified":"2026-05-21T02:12:40.441Z","description":"Learn how to set up a TCP listener and connect to it using Netcat. Discover the different variants of Netcat, how to listen for incoming connections, and what...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f3ba67e617431931b1bd3bf4abbaf1a3?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f3ba67e617431931b1bd3bf4abbaf1a3?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Nick Janetakis","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Nick Janetakis","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/05b22e1c43b541059edfaba1ccc944e6","url":"https://daily.dev/sources/nickjanetakis"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/setting-up-a-tcp-listener-and-connecting-to-it-with-netcat-elnnrnwsw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"openbsd,testing","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Nick Janetakis","item":"https://daily.dev/sources/nickjanetakis"},{"@type":"ListItem","position":3,"name":"Setting Up a TCP Listener and Connecting to It with Netcat"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/setting-up-a-tcp-listener-and-connecting-to-it-with-netcat-elnnrnwsw","comment":[{"@type":"Comment","text":"Great article, but could anyone elaborate on why would I want to connect to an IP/port? In what scenario is that useful? Pls, forgive me my ignorance.","datePublished":"2024-04-16T06:05:52.176Z","url":"https://daily.dev/posts/eLNNrnwsw#c-O4E4KPRXf","author":{"@type":"Person","name":"Honza","url":"https://daily.dev/crs1138","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"}}]}
```

