Permalink
Browse files

README: document new, simpler API

  • Loading branch information...
1 parent e39c26a commit 1b9cfa2224e703d40db397101ea526b29500e038 @TooTallNate committed Jul 15, 2015
Showing with 5 additions and 5 deletions.
  1. +5 −5 README.md
View
@@ -37,7 +37,7 @@ Example
``` js
var http = require('http');
-var proxy = require('proxy-agent');
+var ProxyAgent = require('proxy-agent');
// HTTP, HTTPS, or SOCKS proxy to use
var proxyUri = process.env.http_proxy || 'http://168.63.43.102:3128';
@@ -47,7 +47,7 @@ var opts = {
host: 'jsonip.org',
path: '/',
// this is the important part!
- agent: proxy(proxyUri)
+ agent: new ProxyAgent(proxyUri)
};
// the rest works just like any other normal HTTP request
@@ -63,10 +63,10 @@ function onresponse (res) {
API
---
-### proxy(String uri, Boolean secure) → http.Agent
+### new ProxyAgent(Object|String opts|uri)
-Returns an `http.Agent` instance based off of the given proxy `uri`, and `secure`
-boolean flag. An LRU cache is used, so the same `http.Agent` instance will be
+Returns an `http.Agent` instance based off of the given proxy `opts` or URI
+string. An LRU cache is used, so the same `http.Agent` instance will be
returned if identical args are passed in.

0 comments on commit 1b9cfa2

Please sign in to comment.