Add possibility to get IP and port from an external function