Returns the base address of the API server (https://api.algorithmia.com)
@return the base address of the API server
500305
public static String apiAddress() {
        // Cache the API Address
        if(apiAddress == null) {
            apiAddress = getConfigValue("ALGORITHMIA_API");
        }
        if(apiAddress == null) {
            apiAddress = "https://api.algorithmia.com";
        }

        return apiAddress;
    }
871472
protected String getBaseURL(HttpServletRequest request) {
//        if (forcedBaseAddress != null) {
//            return forcedBaseAddress;
//        }

        String reqPrefix = request.getRequestURL().toString();
        String pathInfo = request.getPathInfo() == null ? "" : request.getPathInfo();
        //fix for CXF-898
        if (!"/".equals(pathInfo) || reqPrefix.endsWith("/")) {
            StringBuilder sb = new StringBuilder();
            // request.getScheme(), request.getLocalName() and request.getLocalPort()
            // should be marginally cheaper - provided request.getLocalName() does
            // return the actual name used in request URI as opposed to localhost
            // consistently across the Servlet stacks

            URI uri = URI.create(reqPrefix);
            sb.append(uri.getScheme()).append("://").append(uri.getRawAuthority());

            //No servletPath will be appended, as in Liberty, each endpoint will be served by one servlet instance
            sb.append(request.getContextPath());

            reqPrefix = sb.toString();
        }
        return reqPrefix;
    }
1325726
protected function _getAppBase()
    {
        $baseUrl = Configure::read('App.base');
        if (!$baseUrl) {
            $request = Router::getRequest(true);
            if (!$request) {
                $baseUrl = '';
            } else {
                $baseUrl = $request->base;
            }
        }
        return $baseUrl . '/';
    }
837330
public String getFormattedAddress() {
        final GeocodeApiResponse.Result firstResult = firstResult(apiResponse);
        return firstResult != null? firstResult.getFormatted_address(): null;
    }
947342
@Override
    public InetAddress getLocalAddress() {
        InetAddress address = null;

        if (udpNetworkLayer != null) {
            address = udpNetworkLayer.getDatagramSocket().getLocalAddress();
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                if (address == null) {
                    Tr.debug(tc, "getLocalAddress == null");
                }
            }
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "getLocalAddress; udpNetworkLayer == null");
            }
        }
        return address;
    }
238519
public byte[] getAddress() {    
        byte[] addr = new byte[4];

        addr[0] = (byte)(( address >>> 24 ) & 0xFF );
        addr[1] = (byte)(( address >>> 16 ) & 0xFF );
        addr[2] = (byte)(( address >>> 8 ) & 0xFF );
        addr[3] = (byte)( address & 0xFF );
        return addr;
    }
341901
public static function base()
    {
        if (! isset(self::$_base)) {
            // Get the base request path
            if (strpos(PHP_SAPI, 'cgi') !== false && !ini_get('cgi.fix_pathinfo')  && !empty($_SERVER['REQUEST_URI'])) {
                // PHP-CGI on Apache with "cgi.fix_pathinfo = 0"
                // We don't have user-supplied PATH_INFO in PHP_SELF
                $path = $_SERVER['PHP_SELF'];
            } else {
                $path = $_SERVER['SCRIPT_NAME'];
            }

            $path = rtrim(dirname($path), '/\\');

            // Sanitize the url since we can't trust the server var
            $path = AnService::get('anahita:filter.url')->sanitize($path);

            self::$_base = AnService::get('anahita:http.url', array('url' => $path));
        }

        return self::$_base;
    }
212724
public function baseURL() {
		if($this->api_is_https) {
			$url = 'https://' . $this->api_host . ($this->api_port != 443?':'.$this->api_port:'');
		} else {
			$url = 'http://' . $this->api_host . ($this->api_port != 80?':'.$this->api_port:'');
		}
		return $url;
	}
810000
public String toBase85String() {
		//first we see if we obtained this address from a base 85 string
		//in the case of a prefix, applying the prefix changes the value
		IPAddressString originator = getAddressfromString();
		if(originator != null && (!isPrefixed() || getNetworkPrefixLength() == IPv6Address.BIT_COUNT) && originator.isBase85IPv6()) {
			return originator.toString();
		}
		String result;
		if(hasNoStringCache() || (result = stringCache.base85String) == null) {
			if(hasZone()) {
				stringCache.base85String = result = getSection().toBase85String(getZone());
			} else {
				result = getSection().toBase85String();//the cache is shared so no need to update it here
			}
		}
		return result;
	}
637634
protected String getRemoteAddress() {
        String ipAddress = this.response.getRequest().getHeader("x-forwarded-for");
        if (ipAddress == null) {
            ipAddress = this.response.getRequest().getHeader("X_FORWARDED_FOR");
            if (ipAddress == null){
                ipAddress = this.response.getRequest().getRemoteAddr();
            }
        }
        return this.response.getRequest().getScheme() + "://" + ipAddress;
    }
504408
public String getHost()
    {
        if (_addr==null)
            return __0_0_0_0;
        
        return _addrIsHost?_addr.getHostName():_addr.getHostAddress();
    }
338939
function getBase58CheckAddress(addressBytes) {
  var hash0 = SHA256(addressBytes);
  var hash1 = SHA256(hash0);
  var checkSum = hash1.slice(0, 4);
  checkSum = addressBytes.concat(checkSum);
  var base58Check = encode58(checkSum);

  return base58Check;
}
1201002
private function getBaseUrl() {
        $uri = $this->getRequest()->getUri();
        return sprintf('%s://%s', $uri->getScheme(), $uri->getHost());
    }
1286439
public InetAddress getLocalAddress() throws IOException {
        return InetAddress.getByName(
            new RqHeaders.Smart(new RqHeaders.Base(this))
                .single("X-Takes-LocalAddress")
        );
    }
138319
public static InetAddress getLocalAddress() {
        if (LOCAL_ADDRESS != null)
            return LOCAL_ADDRESS;
        InetAddress localAddress = getLocalAddress0();
        LOCAL_ADDRESS = localAddress;
        return localAddress;
    }
1047523
public int getHostPort() {
        String host = requestHeaders.getFirst(Headers.HOST);
        if (host != null) {
            //for ipv6 addresses we make sure we take out the first part, which can have multiple occurrences of :
            final int colonIndex;
            if (host.startsWith("[")) {
                colonIndex = host.indexOf(':', host.indexOf(']'));
            } else {
                colonIndex = host.indexOf(':');
            }
            if (colonIndex != -1) {
                try {
                    return Integer.parseInt(host.substring(colonIndex + 1));
                } catch (NumberFormatException ignore) {}
            }
            if (getRequestScheme().equals("https")) {
                return 443;
            } else if (getRequestScheme().equals("http")) {
                return 80;
            }

        }
        return getDestinationAddress().getPort();
    }
85250
public static long getServerId() {
		String ipAddress = getLocalHostAddress();
		try {
			long result = 0;
			String[] array = ipAddress.split("\\.");
			for(String s : array){
				long i = Long.parseLong(s);
				result = 256 * result + i;
			}
			return result;
		} catch (Exception e) {
			return ipAddress.hashCode();
		}
	}