Skip to content

Commit

Permalink
Merge pull request #222 from garronej/master
Browse files Browse the repository at this point in the history
Make request from specific interface.
  • Loading branch information
tomas committed Aug 9, 2018
2 parents 6ea53da + 1406b42 commit 919e851
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -313,6 +313,7 @@ For information about options that've changed, there's always [the changelog](ht
- `headers` : Object containing custom HTTP headers for request. Overrides defaults described below.
- `auth` : Determines what to do with provided username/password. Options are `auto`, `digest` or `basic` (default). `auto` will detect the type of authentication depending on the response headers.
- `stream_length`: When sending streams, this lets you manually set the Content-Length header --if the stream's bytecount is known beforehand--, preventing ECONNRESET (socket hang up) errors on some servers that misbehave when receiving payloads of unknown size. Set it to `0` and Needle will get and set the stream's length for you, or leave unset for the default behaviour, which is no Content-Length header for stream payloads.
- `localAddress` : <string>, IP address. Passed to http/https request. Local interface from witch the request should be emitted.

Response options
----------------
Expand Down
4 changes: 3 additions & 1 deletion lib/needle.js
Expand Up @@ -194,7 +194,9 @@ Needle.prototype.setup = function(uri, options) {
// the basics

var config = {
http_opts : {}, // passed later to http.request() directly
http_opts : {
localAddress: get_option('localAddress', undefined)
}, // passed later to http.request() directly
output : options.output,
proxy : get_option('proxy', defaults.proxy),
parser : get_option('parse_response', defaults.parse_response),
Expand Down

0 comments on commit 919e851

Please sign in to comment.