Setup temporary (for test) TCP server with random port number like Test::TCP (Perl) or Glint (Ruby).