@contrast/agent 4.5.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/bin/VERSION +1 -1
  2. package/bin/linux/contrast-service +0 -0
  3. package/bin/mac/contrast-service +0 -0
  4. package/bin/windows/contrast-service.exe +0 -0
  5. package/lib/assess/membrane/source-membrane.js +4 -18
  6. package/lib/assess/policy/propagators.json +11 -21
  7. package/lib/assess/policy/rules.json +5 -0
  8. package/lib/assess/policy/signatures.json +15 -0
  9. package/lib/assess/propagators/dustjs/escape-html.js +22 -0
  10. package/lib/assess/propagators/dustjs/escape-js.js +22 -0
  11. package/lib/assess/propagators/encode-uri/encode-uri-component.js +22 -0
  12. package/lib/assess/propagators/encode-uri/encode-uri.js +22 -0
  13. package/lib/assess/propagators/index.js +0 -2
  14. package/lib/assess/propagators/joi/values.js +26 -11
  15. package/lib/assess/propagators/mustache/escape.js +22 -0
  16. package/lib/assess/propagators/path/common.js +155 -46
  17. package/lib/assess/propagators/path/join.js +5 -1
  18. package/lib/assess/propagators/path/normalize.js +1 -2
  19. package/lib/assess/propagators/path/resolve.js +11 -2
  20. package/lib/assess/propagators/template-escape.js +84 -0
  21. package/lib/assess/propagators/templates.js +2 -3
  22. package/lib/assess/sinks/dustjs-linkedin-xss.js +131 -0
  23. package/lib/core/arch-components/dynamodb.js +1 -2
  24. package/lib/core/arch-components/dynamodbv3.js +44 -0
  25. package/lib/core/arch-components/index.js +1 -0
  26. package/lib/core/arch-components/rethinkdb.js +53 -0
  27. package/lib/core/async-storage/hooks/bluebird.js +20 -0
  28. package/lib/core/config/options.js +2 -1
  29. package/lib/core/stacktrace.js +3 -4
  30. package/lib/feature-set.js +2 -1
  31. package/lib/hooks/frameworks/base.js +8 -2
  32. package/lib/hooks/frameworks/http.js +23 -16
  33. package/lib/hooks/frameworks/http2.js +73 -0
  34. package/lib/hooks/frameworks/index.js +8 -3
  35. package/lib/hooks/http.js +112 -128
  36. package/lib/hooks/patcher.js +69 -48
  37. package/lib/hooks/require.js +16 -22
  38. package/lib/instrumentation.js +0 -3
  39. package/lib/protect/rules/cmd-injection-command-backdoors/backdoor-detector.js +3 -3
  40. package/lib/protect/rules/signatures/reflected-xss/helpers/function-call.js +1 -1
  41. package/lib/protect/rules/xss/helpers/function-call.js +1 -1
  42. package/lib/util/clean-stack.js +1 -1
  43. package/lib/util/clean-string/brackets.js +3 -3
  44. package/lib/util/ip-analyzer.js +1 -1
  45. package/lib/util/some.js +27 -0
  46. package/lib/util/source-map.js +1 -1
  47. package/lib/util/xml-analyzer/external-entity-finder.js +1 -1
  48. package/package.json +14 -16
  49. package/lib/hooks/frameworks/https.js +0 -42
  50. package/node_modules/bindings/LICENSE.md +0 -22
  51. package/node_modules/bindings/README.md +0 -98
  52. package/node_modules/bindings/bindings.js +0 -221
  53. package/node_modules/bindings/package.json +0 -32
  54. package/node_modules/file-uri-to-path/.npmignore +0 -1
  55. package/node_modules/file-uri-to-path/.travis.yml +0 -30
  56. package/node_modules/file-uri-to-path/History.md +0 -21
  57. package/node_modules/file-uri-to-path/LICENSE +0 -20
  58. package/node_modules/file-uri-to-path/README.md +0 -74
  59. package/node_modules/file-uri-to-path/index.d.ts +0 -2
  60. package/node_modules/file-uri-to-path/index.js +0 -66
  61. package/node_modules/file-uri-to-path/package.json +0 -36
  62. package/node_modules/file-uri-to-path/test/test.js +0 -24
  63. package/node_modules/file-uri-to-path/test/tests.json +0 -13
  64. package/node_modules/glossy/LICENSE +0 -19
  65. package/node_modules/glossy/README.md +0 -129
  66. package/node_modules/glossy/index.js +0 -12
  67. package/node_modules/glossy/lib/glossy/parse.js +0 -520
  68. package/node_modules/glossy/lib/glossy/produce.js +0 -459
  69. package/node_modules/glossy/package.json +0 -47
  70. package/node_modules/glossy/test/decide.js +0 -7
  71. package/node_modules/glossy/test/decode_pri.js +0 -24
  72. package/node_modules/glossy/test/parse_3164.js +0 -104
  73. package/node_modules/glossy/test/parse_5424.js +0 -106
  74. package/node_modules/glossy/test/parse_5848.js +0 -40
  75. package/node_modules/glossy/test/parse_8601.js +0 -14
  76. package/node_modules/glossy/test/parse_rfc3339.js +0 -9
  77. package/node_modules/glossy/test/produce.js +0 -162
  78. package/node_modules/glossy/test/runner.js +0 -40
  79. package/node_modules/glossy/test/structure_data.js +0 -24
  80. package/node_modules/nan/CHANGELOG.md +0 -537
  81. package/node_modules/nan/LICENSE.md +0 -13
  82. package/node_modules/nan/README.md +0 -455
  83. package/node_modules/nan/doc/asyncworker.md +0 -146
  84. package/node_modules/nan/doc/buffers.md +0 -54
  85. package/node_modules/nan/doc/callback.md +0 -76
  86. package/node_modules/nan/doc/converters.md +0 -41
  87. package/node_modules/nan/doc/errors.md +0 -226
  88. package/node_modules/nan/doc/json.md +0 -62
  89. package/node_modules/nan/doc/maybe_types.md +0 -583
  90. package/node_modules/nan/doc/methods.md +0 -664
  91. package/node_modules/nan/doc/new.md +0 -147
  92. package/node_modules/nan/doc/node_misc.md +0 -123
  93. package/node_modules/nan/doc/object_wrappers.md +0 -263
  94. package/node_modules/nan/doc/persistent.md +0 -296
  95. package/node_modules/nan/doc/scopes.md +0 -73
  96. package/node_modules/nan/doc/script.md +0 -38
  97. package/node_modules/nan/doc/string_bytes.md +0 -62
  98. package/node_modules/nan/doc/v8_internals.md +0 -199
  99. package/node_modules/nan/doc/v8_misc.md +0 -85
  100. package/node_modules/nan/include_dirs.js +0 -1
  101. package/node_modules/nan/nan.h +0 -2898
  102. package/node_modules/nan/nan_callbacks.h +0 -88
  103. package/node_modules/nan/nan_callbacks_12_inl.h +0 -514
  104. package/node_modules/nan/nan_callbacks_pre_12_inl.h +0 -520
  105. package/node_modules/nan/nan_converters.h +0 -72
  106. package/node_modules/nan/nan_converters_43_inl.h +0 -68
  107. package/node_modules/nan/nan_converters_pre_43_inl.h +0 -42
  108. package/node_modules/nan/nan_define_own_property_helper.h +0 -29
  109. package/node_modules/nan/nan_implementation_12_inl.h +0 -430
  110. package/node_modules/nan/nan_implementation_pre_12_inl.h +0 -263
  111. package/node_modules/nan/nan_json.h +0 -166
  112. package/node_modules/nan/nan_maybe_43_inl.h +0 -356
  113. package/node_modules/nan/nan_maybe_pre_43_inl.h +0 -268
  114. package/node_modules/nan/nan_new.h +0 -340
  115. package/node_modules/nan/nan_object_wrap.h +0 -156
  116. package/node_modules/nan/nan_persistent_12_inl.h +0 -132
  117. package/node_modules/nan/nan_persistent_pre_12_inl.h +0 -242
  118. package/node_modules/nan/nan_private.h +0 -73
  119. package/node_modules/nan/nan_string_bytes.h +0 -305
  120. package/node_modules/nan/nan_typedarray_contents.h +0 -96
  121. package/node_modules/nan/nan_weak.h +0 -437
  122. package/node_modules/nan/package.json +0 -41
  123. package/node_modules/nan/tools/1to2.js +0 -412
  124. package/node_modules/nan/tools/README.md +0 -14
  125. package/node_modules/nan/tools/package.json +0 -19
  126. package/node_modules/unix-dgram/LICENSE +0 -13
  127. package/node_modules/unix-dgram/README.md +0 -107
  128. package/node_modules/unix-dgram/binding.gyp +0 -20
  129. package/node_modules/unix-dgram/build/Makefile +0 -324
  130. package/node_modules/unix-dgram/build/Release/.deps/Release/obj.target/unix_dgram/src/unix_dgram.o.d +0 -58
  131. package/node_modules/unix-dgram/build/Release/.deps/Release/obj.target/unix_dgram.node.d +0 -1
  132. package/node_modules/unix-dgram/build/Release/.deps/Release/unix_dgram.node.d +0 -1
  133. package/node_modules/unix-dgram/build/Release/obj.target/unix_dgram/src/unix_dgram.o +0 -0
  134. package/node_modules/unix-dgram/build/Release/obj.target/unix_dgram.node +0 -0
  135. package/node_modules/unix-dgram/build/Release/unix_dgram.node +0 -0
  136. package/node_modules/unix-dgram/build/binding.Makefile +0 -6
  137. package/node_modules/unix-dgram/build/config.gypi +0 -213
  138. package/node_modules/unix-dgram/build/unix_dgram.target.mk +0 -159
  139. package/node_modules/unix-dgram/lib/unix_dgram.js +0 -168
  140. package/node_modules/unix-dgram/package.json +0 -36
  141. package/node_modules/unix-dgram/src/unix_dgram.cc +0 -404
  142. package/node_modules/unix-dgram/src/win_dummy.cc +0 -7
  143. package/node_modules/unix-dgram/test/test-connect-callback.js +0 -68
  144. package/node_modules/unix-dgram/test/test-connect.js +0 -53
  145. package/node_modules/unix-dgram/test/test-dgram-unix.js +0 -58
  146. package/node_modules/unix-dgram/test/test-send-error.js +0 -26
  147. package/node_modules/winston-syslog/.eslintrc +0 -7
  148. package/node_modules/winston-syslog/.travis.yml +0 -14
  149. package/node_modules/winston-syslog/CHANGELOG.md +0 -9
  150. package/node_modules/winston-syslog/LICENSE +0 -20
  151. package/node_modules/winston-syslog/README.md +0 -135
  152. package/node_modules/winston-syslog/lib/utils.js +0 -26
  153. package/node_modules/winston-syslog/lib/winston-syslog.js +0 -385
  154. package/node_modules/winston-syslog/package.json +0 -56
  155. package/node_modules/winston-syslog/test/format-test.js +0 -122
  156. package/node_modules/winston-syslog/test/syslog-test.js +0 -95
  157. package/node_modules/winston-syslog/test/unix-connect-test.js +0 -133
@@ -1,74 +0,0 @@
1
- file-uri-to-path
2
- ================
3
- ### Convert a `file:` URI to a file path
4
- [![Build Status](https://travis-ci.org/TooTallNate/file-uri-to-path.svg?branch=master)](https://travis-ci.org/TooTallNate/file-uri-to-path)
5
-
6
- Accepts a `file:` URI and returns a regular file path suitable for use with the
7
- `fs` module functions.
8
-
9
-
10
- Installation
11
- ------------
12
-
13
- Install with `npm`:
14
-
15
- ``` bash
16
- $ npm install file-uri-to-path
17
- ```
18
-
19
-
20
- Example
21
- -------
22
-
23
- ``` js
24
- var uri2path = require('file-uri-to-path');
25
-
26
- uri2path('file://localhost/c|/WINDOWS/clock.avi');
27
- // "c:\\WINDOWS\\clock.avi"
28
-
29
- uri2path('file:///c|/WINDOWS/clock.avi');
30
- // "c:\\WINDOWS\\clock.avi"
31
-
32
- uri2path('file://localhost/c:/WINDOWS/clock.avi');
33
- // "c:\\WINDOWS\\clock.avi"
34
-
35
- uri2path('file://hostname/path/to/the%20file.txt');
36
- // "\\\\hostname\\path\\to\\the file.txt"
37
-
38
- uri2path('file:///c:/path/to/the%20file.txt');
39
- // "c:\\path\\to\\the file.txt"
40
- ```
41
-
42
-
43
- API
44
- ---
45
-
46
- ### fileUriToPath(String uri) → String
47
-
48
-
49
-
50
- License
51
- -------
52
-
53
- (The MIT License)
54
-
55
- Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
56
-
57
- Permission is hereby granted, free of charge, to any person obtaining
58
- a copy of this software and associated documentation files (the
59
- 'Software'), to deal in the Software without restriction, including
60
- without limitation the rights to use, copy, modify, merge, publish,
61
- distribute, sublicense, and/or sell copies of the Software, and to
62
- permit persons to whom the Software is furnished to do so, subject to
63
- the following conditions:
64
-
65
- The above copyright notice and this permission notice shall be
66
- included in all copies or substantial portions of the Software.
67
-
68
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
69
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
70
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
71
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
72
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
73
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
74
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,2 +0,0 @@
1
- declare function fileUriToPath(uri: string): string;
2
- export = fileUriToPath;
@@ -1,66 +0,0 @@
1
-
2
- /**
3
- * Module dependencies.
4
- */
5
-
6
- var sep = require('path').sep || '/';
7
-
8
- /**
9
- * Module exports.
10
- */
11
-
12
- module.exports = fileUriToPath;
13
-
14
- /**
15
- * File URI to Path function.
16
- *
17
- * @param {String} uri
18
- * @return {String} path
19
- * @api public
20
- */
21
-
22
- function fileUriToPath (uri) {
23
- if ('string' != typeof uri ||
24
- uri.length <= 7 ||
25
- 'file://' != uri.substring(0, 7)) {
26
- throw new TypeError('must pass in a file:// URI to convert to a file path');
27
- }
28
-
29
- var rest = decodeURI(uri.substring(7));
30
- var firstSlash = rest.indexOf('/');
31
- var host = rest.substring(0, firstSlash);
32
- var path = rest.substring(firstSlash + 1);
33
-
34
- // 2. Scheme Definition
35
- // As a special case, <host> can be the string "localhost" or the empty
36
- // string; this is interpreted as "the machine from which the URL is
37
- // being interpreted".
38
- if ('localhost' == host) host = '';
39
-
40
- if (host) {
41
- host = sep + sep + host;
42
- }
43
-
44
- // 3.2 Drives, drive letters, mount points, file system root
45
- // Drive letters are mapped into the top of a file URI in various ways,
46
- // depending on the implementation; some applications substitute
47
- // vertical bar ("|") for the colon after the drive letter, yielding
48
- // "file:///c|/tmp/test.txt". In some cases, the colon is left
49
- // unchanged, as in "file:///c:/tmp/test.txt". In other cases, the
50
- // colon is simply omitted, as in "file:///c/tmp/test.txt".
51
- path = path.replace(/^(.+)\|/, '$1:');
52
-
53
- // for Windows, we need to invert the path separators from what a URI uses
54
- if (sep == '\\') {
55
- path = path.replace(/\//g, '\\');
56
- }
57
-
58
- if (/^.+\:/.test(path)) {
59
- // has Windows drive at beginning of path
60
- } else {
61
- // unix path…
62
- path = sep + path;
63
- }
64
-
65
- return host + path;
66
- }
@@ -1,36 +0,0 @@
1
- {
2
- "name": "file-uri-to-path",
3
- "version": "1.0.0",
4
- "description": "Convert a file: URI to a file path",
5
- "main": "index.js",
6
- "types": "index.d.ts",
7
- "directories": {
8
- "test": "test"
9
- },
10
- "scripts": {
11
- "test": "mocha --reporter spec"
12
- },
13
- "repository": {
14
- "type": "git",
15
- "url": "git://github.com/TooTallNate/file-uri-to-path.git"
16
- },
17
- "keywords": [
18
- "file",
19
- "uri",
20
- "convert",
21
- "path"
22
- ],
23
- "author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
24
- "license": "MIT",
25
- "bugs": {
26
- "url": "https://github.com/TooTallNate/file-uri-to-path/issues"
27
- },
28
- "homepage": "https://github.com/TooTallNate/file-uri-to-path",
29
- "devDependencies": {
30
- "mocha": "3"
31
- }
32
-
33
- ,"_resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz"
34
- ,"_integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
35
- ,"_from": "file-uri-to-path@1.0.0"
36
- }
@@ -1,24 +0,0 @@
1
-
2
- var sep = require('path').sep || '/';
3
- var assert = require('assert');
4
- var uri2path = require('../');
5
- var tests = require('./tests.json');
6
-
7
- describe('file-uri-to-path', function () {
8
-
9
- Object.keys(tests).forEach(function (uri) {
10
-
11
- // the test cases were generated from Windows' PathCreateFromUrlA() function.
12
- // On Unix, we have to replace the path separator with the Unix one instead of
13
- // the Windows one.
14
- var expected = tests[uri].replace(/\\/g, sep);
15
-
16
- it('should convert ' + JSON.stringify(uri) + ' to ' + JSON.stringify(expected),
17
- function () {
18
- var actual = uri2path(uri);
19
- assert.equal(actual, expected);
20
- });
21
-
22
- });
23
-
24
- });
@@ -1,13 +0,0 @@
1
- {
2
- "file://host/path": "\\\\host\\path",
3
- "file://localhost/etc/fstab": "\\etc\\fstab",
4
- "file:///etc/fstab": "\\etc\\fstab",
5
- "file:///c:/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi",
6
- "file://localhost/c|/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi",
7
- "file:///c|/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi",
8
- "file://localhost/c:/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi",
9
- "file://hostname/path/to/the%20file.txt": "\\\\hostname\\path\\to\\the file.txt",
10
- "file:///c:/path/to/the%20file.txt": "c:\\path\\to\\the file.txt",
11
- "file:///C:/Documents%20and%20Settings/davris/FileSchemeURIs.doc": "C:\\Documents and Settings\\davris\\FileSchemeURIs.doc",
12
- "file:///C:/caf%C3%A9/%C3%A5r/d%C3%BCnn/%E7%89%9B%E9%93%83/Ph%E1%BB%9F/%F0%9F%98%B5.exe": "C:\\café\\år\\dünn\\牛铃\\Phở\\😵.exe"
13
- }
@@ -1,19 +0,0 @@
1
- Copyright (c) 2010, Squeeks.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
@@ -1,129 +0,0 @@
1
- glossy
2
- ===========
3
-
4
- glossy aims to be a very generic yet powerful library for both producing and
5
- also parsing raw syslog messages. The library aims to be capable of adhearing to
6
- RFC 3164, RFC 5424 and RFC 5848 and by itself does no network interactions, it's
7
- up to you to use this library as a syslog producer, a consumer, relay or
8
- something else entirely. In addition, glossy has no dependencies and can be
9
- bootstrapped to operate in browser or other non-node.js environments.
10
-
11
-
12
- Parsing
13
- -------
14
-
15
- var syslogParser = require('glossy').Parse; // or wherever your glossy libs are
16
-
17
- parsedMessage = syslogParser.parse(message);
18
-
19
- parsedMessage will return an object containing as many parsed values as
20
- possible, as well as the original message. The date value will be a Date object.
21
- Structured data will return as an object. Alternatively, you can give it a
22
- callback as your second argument:
23
-
24
- syslogParser.parse(message, function(parsedMessage){
25
- console.log(parsedMessage);
26
- });
27
-
28
-
29
- Producing
30
- -------
31
- Unless you stipulate for BSD/RFC 3164 style messages, it will default to
32
- generating all messages as newer, RFC 5424 format. This might break consumers or
33
- relays not expecting it.
34
-
35
- var syslogProducer = require('glossy').Produce; // or wherever glossy lives
36
-
37
- var msg = syslogProducer.produce({
38
- facility: 'local4', // these can either be a valid integer,
39
- severity: 'error', // or a relevant string
40
- host: 'localhost',
41
- appName: 'sudo',
42
- pid: '123',
43
- date: new Date(Date()),
44
- message: 'Nice, Neat, New, Oh Wow'
45
- });
46
-
47
- Again, you can specify a callback for the second argument.
48
-
49
- var msg = syslogProducer.produce({
50
- facility: 'ntp',
51
- severity: 'info',
52
- host: 'localhost',
53
- date: new Date(Date()),
54
- message: 'Lunch Time!'
55
- }, function(syslogMsg){
56
- console.log(syslogMsg);
57
- });
58
-
59
- In addition, you can also predefined most of the values when you create the
60
- object, to save having to repeat yourself:
61
-
62
- var syslogProducer = new require('glossy').Produce({
63
- type: 'BSD',
64
- facility: 'ftp',
65
- pid: 42,
66
- host: '::1'
67
- });
68
-
69
- For RFC5424 messages, you can also include structured data. Keys should comply
70
- with the definition in [Section 7, RFC5424](http://tools.ietf.org/html/rfc5424#section-7)
71
- regarding names - keep them unique and your own custom keys should have at least
72
- an @ sign.
73
-
74
- var msg = syslogProducer.produce({
75
- facility: 'local4',
76
- severity: 'error',
77
- host: 'localhost',
78
- appName: 'starman',
79
- pid: '123',
80
- date: new Date(Date()),
81
- message: 'ACHTUNG!',
82
- structuredData: {
83
- 'plack@host': {
84
- status: 'broken',
85
- hasTried: 'not really'
86
- }
87
- }
88
- });
89
-
90
- Finally, we expose all the severities as functions themselves:
91
-
92
- var infoMsg = glossy.info({
93
- message: 'Info Message',
94
- });
95
-
96
- Function names facilitating this are named debug, info, notice, warn, crit,
97
- alert and emergency.
98
-
99
- Parsing Example
100
- -------
101
- Handle incoming syslog messages coming in on UDP port 514:
102
-
103
- var syslogParser = require('glossy').Parse; // or wherever your glossy libs are
104
- var dgram = require("dgram");
105
- var server = dgram.createSocket("udp4");
106
-
107
- server.on("message", function(rawMessage) {
108
- syslogParser.parse(rawMessage.toString('utf8', 0), function(parsedMessage){
109
- console.log(parsedMessage.host + ' - ' + parsedMessage.message);
110
- });
111
- });
112
-
113
- server.on("listening", function() {
114
- var address = server.address();
115
- console.log("Server now listening at " +
116
- address.address + ":" + address.port);
117
- });
118
-
119
- server.bind(514); // Remember ports < 1024 need suid
120
-
121
-
122
- Author
123
- -------
124
- Squeeks - privacymyass@gmail.com
125
-
126
- License
127
- -------
128
- This is free software licensed under the MIT License - see the LICENSE file that
129
- should be included with this package.
@@ -1,12 +0,0 @@
1
- /*
2
- * Imports
3
- */
4
-
5
- var producer = require('./lib/glossy/produce.js');
6
- var parser = require('./lib/glossy/parse.js');
7
-
8
- /*
9
- * Exports
10
- */
11
- exports.Produce = producer;
12
- exports.Parse = parser;