<pre>
The IP address (IPv4 or IPv6) of the origin server that the request was
sent to.
</pre>

<code>string server_ip = 13;</code>
509558
public com.google.protobuf.ByteString
      getServerIpBytes() {
    java.lang.Object ref = serverIp_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      serverIp_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
88139
public DescribeIpResponse describeIp(String ip) {
        DescribeIpRequest request = new DescribeIpRequest()
                .withIp(ip);
        return describeIp(request);
    }
1256930
public String DoPut(Request request) throws Exception {

        Unirest.setHttpClient(getHttpClient());

        if (request.client == null) {
            throw new Exception("client must NOT null");
        }

        String buf = "";
        if (request.client.GetEnableCrypto()) {
            buf = request.crypto.signAndEncrypt(request.body.toString().getBytes());
        } else {
            buf = request.body.toString();
        }

        Map<String, String> mapHeader = Utils.JsonToMap(request.header);
        mapHeader.put(Headers.APIKeyHeader, request.client.GetApiKey());

        if (request.client.GetRouteTag() != "") {
            mapHeader.put(Headers.FabioRouteTagHeader, request.client.GetRouteTag());
            mapHeader.put(Headers.RouteTagHeader, request.client.GetRouteTag());
        }

        HttpResponse<String> res = Unirest.put(request.url).headers(mapHeader).body(buf).asString();

        String respData = res.getBody();

        System.out.println("Got remote cipher response: " + respData);

        String oriData = "";
        if (request.client.GetEnableCrypto()) {
            oriData = request.crypto.decryptAndVerify(respData.getBytes());
        } else {
            oriData = respData;
        }
        return oriData;

    }
455475
private String[] probeIps() {
        Set<String> ips = new TreeSet<String>();
        for (int i = 0; i < 32; ++i) {
            InetSocketAddress sa = new InetSocketAddress(_server, _port);
            ips.add(sa.getAddress().getHostAddress());
        }

        if (LOG.isDebugEnabled()) {
            StringBuffer sb = new StringBuffer();
            for (String ip : ips) {
                sb.append(ip);
                sb.append(" ");
            }
            LOG.debug(sb.toString());
        }

        return (String[]) ips.toArray(new String[0]);
    }
620078
public static int ipv4StringToInt(String ipv4Str) {
		byte[] byteAddress = ip4StringToBytes(ipv4Str);
		if (byteAddress == null) {
			return 0;
		} else {
			return NumberUtil.toInt(byteAddress);
		}
	}
594858
public String toMixedString() {
		String result;
		if(hasNoStringCache() || (result = stringCache.mixedString) == null) {
			if(hasZone()) {
				stringCache.mixedString = result = toNormalizedString(IPv6StringCache.mixedParams);
			} else {
				result = getSection().toMixedString();//the cache is shared so no need to update it here
			}
		}
		return result;
	}
539424
public InetSocketAddress serverAddress() {
        try {
            return serverSocketChannel == null ? serverAddress
                : (InetSocketAddress) serverSocketChannel.getLocalAddress();
        } catch (IOException e) {
            return serverAddress;
        }
    }
532220
public int getServerPort()
  {
    String host = null;

    CharSequence rawHost;
    if ((rawHost = getHost()) != null) {
      int length = rawHost.length();
      int i;

      for (i = length - 1; i >= 0; i--) {
        if (rawHost.charAt(i) == ':') {
          int port = 0;

          for (i++; i < length; i++) {
            char ch = rawHost.charAt(i);

            if ('0' <= ch && ch <= '9') {
              port = 10 * port + ch - '0';
            }
          }

          return port;
        }
      }

      // server/0521 vs server/052o
      // because of proxies, need to use the host header,
      // not the actual port
      return isSecure() ? 443 : 80;
    }

    if (host == null) {
      return connTcp().portLocal();
    }

    int p1 = host.lastIndexOf(':');

    if (p1 < 0)
      return isSecure() ? 443 : 80;
    else {
      int length = host.length();
      int port = 0;

      for (int i = p1 + 1; i < length; i++) {
        char ch = host.charAt(i);

        if ('0' <= ch && ch <= '9') {
          port = 10 * port + ch - '0';
        }
      }

      return port;
    }
  }
206611
public static String getClientIP(HttpRequestInfo request)
    {
        final String xForwardedFor = request.getHeaders().getFirst(HttpHeaderNames.X_FORWARDED_FOR);
        String clientIP;
        if (xForwardedFor == null) {
            clientIP = request.getClientIp();
        } else {
            clientIP = extractClientIpFromXForwardedFor(xForwardedFor);
        }
        return clientIP;
    }
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();
    }
1356686
function () {
    var self = this;

    // For the reported client address for a connection to be correct,
    // the developer must set the HTTP_FORWARDED_COUNT environment
    // variable to an integer representing the number of hops they
    // expect in the `x-forwarded-for` header. E.g., set to "1" if the
    // server is behind one proxy.
    //
    // This could be computed once at startup instead of every time.
    var httpForwardedCount = parseInt(process.env['HTTP_FORWARDED_COUNT']) || 0;

    if (httpForwardedCount === 0)
      return self.socket.remoteAddress;

    var forwardedFor = self.socket.headers["x-forwarded-for"];
    if (! _.isString(forwardedFor))
      return null;
    forwardedFor = forwardedFor.trim().split(/\s*,\s*/);

    // Typically the first value in the `x-forwarded-for` header is
    // the original IP address of the client connecting to the first
    // proxy.  However, the end user can easily spoof the header, in
    // which case the first value(s) will be the fake IP address from
    // the user pretending to be a proxy reporting the original IP
    // address value.  By counting HTTP_FORWARDED_COUNT back from the
    // end of the list, we ensure that we get the IP address being
    // reported by *our* first proxy.

    if (httpForwardedCount < 0 || httpForwardedCount > forwardedFor.length)
      return null;

    return forwardedFor[forwardedFor.length - httpForwardedCount];
  }
259510
static public String getExternalIpAddress(){
		String ip = null;
		URL url = null;
		BufferedReader in = null;
		
		for (int i = 0; !isIPv4Address(ip) && i < CHECK_IP_ENDPOINTS.length; i ++, url = null, in = null){
			try{
				url = new URL(CHECK_IP_ENDPOINTS[i]);
				in = new BufferedReader(new InputStreamReader(url.openStream()));
				ip = in.readLine(); //you get the IP as a String
			}catch(Exception e){
				System.err.println("Unable to find out external IP address through end point '" + CHECK_IP_ENDPOINTS[i] + "': " + e.getMessage());
				if (in != null){
					try{
						in.close();
					}catch(Exception e2){
						// ignore
					}
				}
			}
		}
		return ip;
		
	}
936137
public static String getIP(final InetAddress inetAddress)
	{
		String ip = "";
		ip = inetAddress.getHostAddress();
		if (ip.equals(""))
		{
			final byte[] ipAddressInBytes = inetAddress.getAddress();
			for (int i = 0; i < ipAddressInBytes.length; i++)
			{
				if (i > 0)
				{
					ip += ".";
				}
				ip += ipAddressInBytes[i] & 0xFF;
			}
		}
		return ip;
	}
1066965
public Integer getNetworkPrefixLength() {
		if(isAddress()) {
			return parsedHost.asAddress().getNetworkPrefixLength();
		} else if(isAddressString()) {
			return parsedHost.asGenericAddressString().getNetworkPrefixLength();
		}
		return isValid() ? parsedHost.getNetworkPrefixLength() : null;
	}
957291
public static String extractIPAddress(final HttpServletRequest request) {

        String ip = request.getHeader("x-forwarded-for");
        if (isIPAdressValid(ip)) {
            return ip;
        }
        ip = request.getHeader("Proxy-Client-IP");
        if (isIPAdressValid(ip)) {
            return ip;
        }
        ip = request.getHeader("WL-Proxy-Client-IP");
        if (isIPAdressValid(ip)) {
            return ip;
        }
        return request.getRemoteAddr();
    }
1190215
protected RFC3881NetworkAccessPointTypeCodes getNetworkAccessPointCodeFromAddress(String address) {
        if (EventUtils.isEmptyOrNull(address)) {
            return null;
        }

        if (address.matches("^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$")) {
            return RFC3881NetworkAccessPointTypeCodes.IP_ADDRESS;
        }

        return RFC3881NetworkAccessPointTypeCodes.MACHINE_NAME;
    }
378249
public InetAddress asInetAddress() {
		if(isValid() && isAddressString()) {
			IPAddress ipAddr = asAddress();
            if(ipAddr != null) {
            	return ipAddr.toInetAddress();
            }
		}
		return null;
	}