Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make request from specific interface. #222

Merged
merged 1 commit into from Aug 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -312,6 +312,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 @@ -191,7 +191,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