Skip to content

Commit

Permalink
Add documentation for options.limit.
Browse files Browse the repository at this point in the history
This option can only be found in the code or in issue villadora#27 but is
quite important to know when using the proxy for large request.
  • Loading branch information
Granjow committed Nov 9, 2016
1 parent 2429558 commit b6cffd5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ app.use(proxy('httpbin.org', {
```

#### filter

The ```filter``` option can be used to limit what requests are proxied. For example, if you only want to proxy get request

```js
Expand All @@ -73,6 +74,7 @@ app.use('/proxy', proxy('www.google.com', {
```

#### intercept

You can intercept the response before sending it back to the client.

```js
Expand All @@ -85,6 +87,18 @@ app.use('/proxy', proxy('www.google.com', {
}));
```

#### limit

This sets the body size limit (default: `1mb`). If the body size is larger than the specified (or default) limit,
a `413 Request Entity Too Large` error will be returned. See [bytes.js](https://www.npmjs.com/package/bytes) for
a list of supported formats.

```js
app.use('/proxy', proxy('www.google.com', {
limit: '5mb'
}));
```

#### decorateRequest

You can change the request options before it is sent to the target.
Expand Down

0 comments on commit b6cffd5

Please sign in to comment.