superjoe30/node-minecraft-protocol — pull request #72 by deathcap (2014-01-07 05:54:49+00:00)
Title: Add writeRaw() and option to receive raw, unparsed packet fields

Adds two new features:

* `writeRaw(buffer, shouldEncrypt)`: allows you to write raw packet buffers, instead of having `write(packetId, params)` encode the packet. Better than client.socket.write() since it will encrypt the packet for you if encryption is enabled (unless the shouldEncrypt argument is false; default true)

* client `this.shouldParsePayload`: if false (default true), then incoming packet payloads will not be parsed. Only the header will be parsed, and instead of parsed fields you'll get back "raw" set to the raw undecoded packet. The application can alter this flag at any time to change the parsing behavior (for example, it could be set in an event handler for login_success, after the handshaking has completed and the server is ready to pass through raw packets).

Both are mainly useful for proxies, where the proxy does not need or have full knowledge of each packet payload (using these changes in a WebSocket<->Minecraft proxy: https://github.com/deathcap/wsmc)