What I was trying to perform appeared to be virtually impossible on Windows (or any other popular OS) due to restriction on stealing other application's ports on TCP sockets.
It works for UDP though, like Skype did 15 years ago.
TCP code is somewhere in UDP files, because I was too lazy to refactor during debugging.