code: def lookup_endpoint(cli):
      
      url = '/applications/{0}/environment'.format(APPNAME)
      environ = cli.user.get(url).item
      port = environ['DOTCLOUD_SATELLITE_ZMQ_PORT']
      host = socket.gethostbyname(environ['DOTCLOUD_SATELLITE_ZMQ_HOST'])
      return "tcp://{0}:{1}".format(host, port)
docs: Looks up the application endpoint from dotcloud