Skip to content

Commit

Permalink
Merge 9b919cb into a30c2d8
Browse files Browse the repository at this point in the history
  • Loading branch information
cconcannon committed Feb 10, 2020
2 parents a30c2d8 + 9b919cb commit 98a9868
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -36,6 +36,19 @@ Castle API. However in some cases you want to track data to Castle from a contex
where these globals are not available, eg. when tracking async in a background
worker. In this case you can build the request context manually.

### Origin IP Address
By default, the SDK extracts the contextual client IP address from headers in the following priority:
1. `X-Forwarded-For`
2. `X-Real-Ip`
3. `REMOTE_ADDR`

If the true client IP address is not specified in the above headers, you can manually set the IP address like so:

```php
Castle_RequestContext['ip'] = '1.1.1.1'
$context = Castle_RequestContext::extractJson();
```

#### Example

```php
Expand Down

0 comments on commit 98a9868

Please sign in to comment.