added template methods for getting http and https ports.