extract get_local_ip and get_peer_ip to app utility