Ok, I am at work and we are barried by a proxy and I want to find an available port out... (naturally I am not supposed to know, for security reasons)

I want to make a chat program for my wife and I, but I need to find the correct port out.

Any Ideas on how to code an app that attempts all ports 1,2,3,so on, effectively logging open ports out?