Caveat: If your debugging only requires a single connection, and you don't need to specifically debug connect/disconnect events...
You could use
nc on some systems).
You set your application to open, say, port 12345 (user-openable). Then you use netcat to open, say, port 123 (privileged-users-only) and forward the data to port 12345.
# sudo nc -l 123 | nc localhost 12345
The first half of the command runs netcat
nc and tells it to listen
-l on port
123. The pipe redirects data from the first netcat instance to another one. The second command connects to your application and forwards the data through.
Note that as soon as you run this command, the second instance of netcat will connect to your application. If your application is going to start pushing out data immediately, you will want to connect your client very quickly, and will need to be careful about how data is buffered.
If you want the client to be able to disconnect and reconnect without having to restart netcat, then instead run:
# sudo nc -lk 123 | nc localhost 12345
-k tells netcat to keep running if the client disconnects from port 123.
Again, there's limitations with this method, as you're largely giving up control of the connection side of things by having netcat handle it for you. On the other hand, it's very quick and easy to set up and tear down, if that's all you need.