Skip to content

Commit

Permalink
Merge pull request #15 from Skadabr/master
Browse files Browse the repository at this point in the history
adding remapHost method
  • Loading branch information
zzo committed Sep 26, 2014
2 parents 71733a9 + e5afc7a commit 7294e3f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,15 @@ Full API
* Headers to set
* CALLBACK(ERROR) function
1. ERROR string if there was an error


**remapHosts(PORT, '{"example.com": "1.2.3.4"}', CALLBACK)**

Overrides normal DNS lookups and remaps the given hosts with the associated IP address
Payload data should be json encoded set of name/value pairs (ex: {"example.com": "1.2.3.4"})

PARAMETERS:

* PORT of proxy for this command
* Hosts to remap
* CALLBACK(ERROR) function
1. ERROR string if there was an error
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ Proxy.prototype = {
req.write(postData);
}
req.end();
},

remapHosts: function (port, postData, cb) {
this.doReq('POST', '/proxy/' + port + '/hosts', postData, cb)
}
};

Expand Down

0 comments on commit 7294e3f

Please sign in to comment.