def allowed?(to_url, from_url)
      to_url.host.nil? || (to_url.host == from_url.host)
    end
def allowed?(to_url, from_url)
      to_url.host.nil? || (to_url.host == from_url.host)
    end
Allowed to connect to the requested url?