tcp_tap is a utility for adding a TCP-tap to console programs
- Multi-session TCP-IP interactivity
- Adding ability by wrapping sub-commands similar to GNU coreutils: stdbuf
- Adds a
tee
, but onstdin
Originally intended to extend gdb front-ends that lack a console (like for example kdbg). It can however be used for any program which uses stdio to communicate (including interactive console programs which communicate with the shell). tcp_tap sits in-between the io-stream and listens at a port.
When someone connects to that port, a new "tap"-session will be created for that client. Everything sent in-between the original program and it's original client will be replicated back and forth to the new client as well.
Adding TCP-IP abilities to console programs can be done in many ways. Like
the classic initd
/xinitd
or netcat
You would use tcp-tap
either when:
- Get in-between two programs (typically front- vs. back-ends)
- Multisession (queued) is required
By not accepting any arguments of it's own and send everything to the wrapped command, tcp-tap is able to add it's extended features also to programs (normally GUI front-ends) that have it's back-end hard-coded.
tcp-tap
binary and libraries (installed)
cmake .
ccmake .
make
sudo make install
make clean
Examples are built separately. Use above installed library.
cd examples/
cmake .
ccmake .
make
- Set a few environment variables
- Wrapped inside a shell-sript
- Optionally (i.e. if needed) rename this script to the intended command and
change the
$PATH
This stealthy ability makes it possible to extend without requiring modification.
An example of how to use in this script: gdb.tap.sh
Note: Whence on TCP stream, terminal awareness and features are either lost or (probably) not functional.
To clone the project including it's git sub-modules:
git clone --recursive https://github.com/mambrus/tcp_tap.git
Browse the Wiki for more information.