jPunch is a Java library that helps you perform UDP hole punching between two random peers on the Internet. It works as long as there is a possibility for indirect communication between the peers (like ssh port forwarding via another server or a chat connection).