For consistency I would use:  context.espIPAddress and not "location.hostname" (plus location.hostname will be wrong for cross site calls.