Tool for listening on a network port and forwarding data to an application?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Tool for listening on a network port and forwarding data to an application?
Hello everybody!
May be that I have gotten things mixed up, but I seem to recall there being some program that was able to listen on a specified port and to run a specified program whenever something came in on that port... But I just can't find what the name of this tool was. And before I start rolling my own solution, I thought I'd ask if anyone knows of this
What kind of thing? is this meant to be sniffing data, or something dedicated? iptables can watch a tcp connection and match strings, it's then possible to push that out to a log to watch and execute based on... or netcat is a simple way to recieve data and pass to a script for inspection.
Well, what I have is an application that takes a bit of data and prints out a result. I remember that there was some tool that I could tell to listen on port X, and when data comes in, to do something with this data (in my case: write it to a file and start the application).
Basically I'm looking to create a very lightweight web servicey thing, and I thought there was something lighter than a full web server for doing this.
well yeah, you can make netcat listen and pipe the output to whatever you want. That way can lie security risks of course... but it's amazingly simple to do. Also trivial to run a perl / python / etc. script to listen on a port and process incoming data too plenty of examples online to modify.
Thanks, netcat was what I'm looking for I already have python scripts doing more complex stuff (where session handling and such is necessary), but I was hoping to get around this, since the current problem is pretty trivial. I don't like using a tank to shoot flies
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.