项目原始demo,不改动
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

1234567891011121314151617181920212223242526272829
  1. # HTTP Parser
  2. This library parses HTTP protocol for requests and responses. It was created to replace `http_parser.c` since calling C++ function from JS is really slow in V8.
  3. This was further modified by Jimbly to be useable in parsing responses, specifically tested with the "request" module, and addresses issues such as corrupt HTTP headers, which would otherwise cause Node's parser to throw a fatal error (HPE_INVALID_HEADER_TOKEN).
  4. Jan Schär (jscissr) made some bigger changes and added tests. This fixed some bugs and added many missing features.
  5. This is packaged as a standalone npm module. To use in node, monkeypatch HTTPParser.
  6. ```js
  7. // Monkey patch before you require http for the first time.
  8. process.binding('http_parser').HTTPParser = require('http-parser-js').HTTPParser;
  9. var http = require('http');
  10. // ...
  11. ```
  12. ## Testing
  13. Simply do `npm test`. The tests are copied from node and mscedex/io.js, with some modifcations.
  14. ## Status
  15. This should now be usable in any node application, it now supports (nearly) everything `http_parser.c` does while still being tolerant with corrupted headers.
  16. ## License
  17. MIT. See LICENSE.md