def build_url(port, host):
    """
    Returns full url combining host(if not specified will use the output of :func:`python:socket.gethostname`) & port

    :param port: integer string for the port to be used by the :class:`flask:flask.Flask` process
    :type port: str
    :param host: hostname, can start with 'http://', 'https://' or just the hostname itself
    :type host: str, optional
    :return: str
    """
    final_port = ':{}'.format(port) if port is not None else ''
    if (host or '').startswith('http'):
        return '{}{}'.format(host, final_port)
    return 'http://{}{}'.format(host, final_port)
