-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from MindscapeHQ/bh/capture-remote-ip
Add option to set clients ip
- Loading branch information
Showing
11 changed files
with
144 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "raygun4js", | ||
"version": "2.16.1", | ||
"version": "2.17.0", | ||
"homepage": "http://raygun.io", | ||
"authors": [ | ||
"Mindscape <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Raygun4JS with Client IP</title> | ||
<script src="/fixtures/common/instrumentXHRs.js"></script> | ||
<script type="text/javascript"> | ||
!function(a,b,c,d,e,f,g,h){a.RaygunObject=e,a[e]=a[e]||function(){ | ||
(a[e].o=a[e].o||[]).push(arguments)},f=b.createElement(c),g=b.getElementsByTagName(c)[0], | ||
f.async=1,f.src=d,g.parentNode.insertBefore(f,g),h=a.onerror,a.onerror=function(b,c,d,f,g){ | ||
h&&h(b,c,d,f,g),g||(g=new Error(b)),a[e].q=a[e].q||[],a[e].q.push({ | ||
e:g})}}(window,document,"script","/dist/raygun.js","rg4js"); | ||
</script> | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
rg4js('apiKey', 'abcd=='); | ||
rg4js('enablePulse', true); | ||
rg4js('options', { | ||
allowInsecureSubmissions: true, | ||
debugMode: true, | ||
clientIp: '192.168.0.12' | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Raygun4JS without Client IP</title> | ||
<script src="/fixtures/common/instrumentXHRs.js"></script> | ||
<script type="text/javascript"> | ||
!function(a,b,c,d,e,f,g,h){a.RaygunObject=e,a[e]=a[e]||function(){ | ||
(a[e].o=a[e].o||[]).push(arguments)},f=b.createElement(c),g=b.getElementsByTagName(c)[0], | ||
f.async=1,f.src=d,g.parentNode.insertBefore(f,g),h=a.onerror,a.onerror=function(b,c,d,f,g){ | ||
h&&h(b,c,d,f,g),g||(g=new Error(b)),a[e].q=a[e].q||[],a[e].q.push({ | ||
e:g})}}(window,document,"script","/dist/raygun.js","rg4js"); | ||
</script> | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
rg4js('apiKey', 'abcd=='); | ||
rg4js('enablePulse', true); | ||
rg4js('options', { | ||
allowInsecureSubmissions: true, | ||
debugMode: true, | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* globals describe, beforeEach, it, expect, browser, window */ | ||
|
||
var _ = require('underscore'); | ||
|
||
describe("ClientIp", function() { | ||
|
||
it("X-Remote-Address is null when not set", function () { | ||
browser.url('http://localhost:4567/fixtures/v2/withoutClientIpSet.html'); | ||
|
||
browser.pause(4000); | ||
|
||
var sentXhrs = browser.execute(function () { | ||
return window.__sentXHRs; | ||
}); | ||
|
||
var remoteAddressIsUndefined = _.every(sentXhrs.value, function (req) { | ||
return req.clientIp === null; | ||
}); | ||
|
||
expect(remoteAddressIsUndefined).toBe(true); | ||
}); | ||
|
||
it("X-Remote-Address is equal to '192.168.0.12'", function () { | ||
browser.url('http://localhost:4567/fixtures/v2/withClientIpSet.html'); | ||
|
||
browser.pause(4000); | ||
|
||
var sentXhrs = browser.execute(function () { | ||
return window.__sentXHRs; | ||
}); | ||
|
||
var remoteAddressIsSet = _.every(sentXhrs.value, function (req) { | ||
return req.clientIp === "192.168.0.12"; | ||
}); | ||
|
||
expect(remoteAddressIsSet).toBe(true); | ||
}); | ||
}); |