A simple program for redirecting stdout and stdin to network ports.
bashis used in this example just as a simple program. You should not use bash or another shell with airport, as it will expose your computer over the network.
Using airport is super simple. It takes one argument, the command to run. For example:
$ airport /bin/bash
Then, in another terminal window:
$ nc localhost 8080 cat hello.txt Hello, world
To specify a port, simply use the
$ airport --address :1234 /bin/bash
As of right now,
stdout are redirected over the network, while
stderr is output to the local computer’s stderr. If you want you can change this with the
--redirectStderr flag, for example:
$ airport --address :1234 --redirectStderr /bin/bash
$ airport --help Usage of airport: -address string the address to listen on (default ":8080") -redirectStderr redirects stderr over the network