diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..94bd206 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +CHANGELOG +========= + +0.2.0 (2013-10-10) + +- Added `options` parameter, ability to disable strict protocol checks. Thanks to kylegetson. + +0.1.2 (2013-08-01) + +- Removed a `console.log` call that was accidentally left in. + +0.1.1 (2013-07-31) + +- Initial release. \ No newline at end of file diff --git a/README.md b/README.md index d557fb1..c92b9d1 100644 --- a/README.md +++ b/README.md @@ -36,4 +36,15 @@ You can do the same with `net` (raw TCP streams), `https`, and `spdy`. It will var proxiedSpdy = require('proxywrap').proxy(require('spdy').server); -**Warning:** *All* traffic to your proxied server MUST use the PROXY protocol. If the first five bytes received aren't `PROXY`, the connection will be dropped. Obviously, the node server accepting PROXY connections should not be exposed directly to the internet; only the proxy (whether ELB, HAProxy, or something else) should be able to connect to node. \ No newline at end of file +**Warning:** By default, *all* traffic to your proxied server MUST use the PROXY protocol. If the first five bytes received aren't `PROXY`, the connection will be dropped. Obviously, the node server accepting PROXY connections should not be exposed directly to the internet; only the proxy (whether ELB, HAProxy, or something else) should be able to connect to node. + +API +--- + +### `proxy(Server[, options])` + +Wraps something that inherits from the `net` module, exposing a `Server` and `createServer`. Returns the same module patched to support the PROXY protocol. + +Options: + +- `strict` (default `true`): Incoming connections MUST use the PROXY protocol. If the first five bytes received aren't `PROXY`, the connection will be dropped. Disabling this option will allow connections that don't use the PROXY protocol (so long as the first bytes sent aren't `PROXY`). Disabling this option poses a security risk; it should be enabled in production. diff --git a/package.json b/package.json index 343b0f7..b7fd8f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "proxywrap", - "version": "0.1.2", + "version": "0.2.0", "description": "Wraps node's Server interfaces to be compatible with the PROXY protocol", "main": "proxywrap.js", "engines": { "node": ">= 0.10.0" },