UNPKG

2.87 kBMarkdownView Raw
1# Hoxy
2
3An HTTP hacking tool for JavaScript programmers. Document can be found here: http://greim.github.io/hoxy/
4
5```js
6import { Proxy } from 'hoxy'
7let proxy = new Proxy().listen(8080)
8proxy.intercept({
9 phase: 'response',
10 mimeType: 'text/html',
11 as: '$'
12}, (req, resp) => {
13 resp.$('title').text('Unicorns!')
14})
15```
16
17# Version 2.0
18
19As of mid-2015 Hoxy has released version 2.0.
20This release keeps a the API nearly identical to 1.x, but much of the internals are re-written.
21Most notably, 2.0 contains:
22
23 * HTTPS direct proxying.
24 * In lieu of calling done(), asynchronous interceptors can return promises or iterators.
25 * Refactor and simplification of internals, including streams, async logic, and unit tests.
26 * Various bugfixes and performance improvements.
27
28# Release notes:
29
30* **2.2.3** Fixed broken reference to lodash-node in CLI.
31* **2.2.2** Updated hoxy version in CLI.
32* **2.2.1** Fixed error in npmignore.
33* **2.2.0** Added proxy-level throttling.
34* **2.1.1** Ditched babel require hook and instead use compile/prepublish.
35* **2.1.0** Ability to run reversy proxy as an HTTPS server. Thanks [@snoj](https://github.com/snoj).
36* **2.0.0** Direct HTTPS proxying and improved async support in interceptors. Thanks [@snoj](https://github.com/snoj), [@Phoenixmatrix](https://github.com/Phoenixmatrix), [@sholladay](https://github.com/sholladay) and others for helping with the HTTPS stuff!
37* **1.2.4** Improved cheerio markup serialization. Thanks [Seth Holladay](https://github.com/sholladay).
38* **1.2.3** Test command now `npm test` instead of `mocha`. Proxy `close()` method now passes args through to server close. Thanks [Seth Holladay](https://github.com/sholladay).
39* **1.2.2** Fixed errors and test failures occurring on io.js.
40* **1.2.1** Make `listen()` accept same args as native `server.listen()` instead of just port. Thanks [Seth Holladay](https://github.com/sholladay).
41* **1.2.0** Send content-length whenever reasonably possible. (minor version bump since minor alteration to existing behavior)
42* **1.1.5** Default protocol to 'http:' if not found because I'm a genius.
43* **1.1.4** Default protocol to 'http' if not found.
44* **1.1.3** Don't munge content-length headers unless necessary.
45* **1.1.2** Burned a version number because I suck at npm.
46* **1.1.1** Added SSL support for requests (protocol: https).
47* **1.1.0** Added CLI functionality to scaffold new proxy projects.
48* **1.0.5** Fixed static conditional get fail, flexible contentType matching, ability to set fullUrl.
49* **1.0.4** npm distribution no longer contains test directory.
50* **1.0.3** Fixed issue #21 causing breakage on windows, due to use of unix domain sockets.
51* **1.0.2** Added `tee()` method to requests and responses, and accompanying tests.
52* **1.0.1** Fixed bug with URL pattern matching, added filtering tests.
53* **1.0.0** Initial release of Hoxy 1.0 rewrite.