You could try out the following approach:
Inject the HTTPServletRequest
parameter into your APIMethod.
@ApiMethod(path = "resources/{id}")
public Resource get(@Named("id") int id, HttpServletRequest request) {
//Use the request parameter here...
}
From the request parameter above, use the following:
String host = request.getRemoteHost();
Keep in mind that the host value can be your client or proxy's host name.