I know that each port can only be assigned to one app. However, I want to do this:
(1) I want to monitor a port, such as 80. This port is already assigned by another app, such as Apache
(2) I can copy every sockets sent to that port, and redirect those ports to another port
I have searched tcpdump, it can capture packets(with whole content). But I do not how to copy packets and then send them to another port?
Or, maybe there are other tools can capture packet easily?
Can give me some details if I want to implement myself? because I am not good at socket programming.