About

tcpconndbg is a tool to help debug TCP network applications. It is a proxy server which listens on a network port and forwards all data between two endpoints, displaying it as it is transferred. It is mostly useful for network applications that speak ASCII-based line-oriented protocols, such as HTTP and SMTP.

tcpconndbg is written in C, and is very portable. I have personally compiled it on FreeBSD, OpenBSD, multiple versions of Linux, Mac OS X, Solaris, Digital UNIX, SGI IRIX, and HPUX.

Please email me with any problems or suggestions.

Example Use

Starting tcpconndbg:

[8 sengelha@sirius]% ./tcpconndbg localhost 25
localhost:8025 <==> localhost:25

The response line states that tcpconndbg is listening on port 8025, and it will forward all traffic to/from port 25 on localhost. By default tcpconndbg listens to port 8000 + remotePort, but this may be overridden using the -l option.

Connecting to tcpconndbg using a network application:

[1 sengelha@sirius]% telnet localhost 8025
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 xxx.yyy.zzz.com ESMTP Postfix

What tcpconndbg looks like as you send data across the connection:

[8 sengelha@sirius]% ./tcpconndbg localhost 25
localhost:8025 <==> localhost:25
Connection #0 established by 127.0.0.1:1457
==> (0) 220 xxx.yyy.zzz.com ESMTP Postfix\r\n
<== (0) HELO my.domain\r\n
==> (0) 250 xxx.yyy.zzz.com\r\n
<== (0) MAIL FROM: <sengelha@my.domain>\r\n
==> (0) 250 Ok\r\n
<== (0) RCPT TO: <sengelha@my.domain>\r\n
==> (0) 250 Ok\r\n
<== (0) DATA\r\n
==> (0) 354 End data with <CR><LF>.<CR><LF>\r\n
<== (0) Hello!!!\r\n
<== (0) .\r\n
==> (0) 250 Ok: queued as ED40D20F5A\r\n
<== (0) QUIT\r\n
==> (0) 221 Bye\r\n
Connection #0 closed by server

Release News

  • 1.2: Fix compile errors on AIX.
  • 1.1: Fix zombie process bug reported by Peter Viskup.
  • 1.0: First public release.

Download

Previous Releases