Fixed the issue with obtaining a public IP.

Also, added an example implementation of how to use the ConnectionPolicyFactory.