Now is possible to send packets to local apps.
Avoid sending a loopback packet to network.
Move the loopback code to a specific function.