added api to get local/remote port.