Skip to content

Commit

Permalink
set proxy socket timeout
Browse files Browse the repository at this point in the history
Fixes #6377
  • Loading branch information
w33ble committed Mar 2, 2016
1 parent 7f4b548 commit c91a17e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/plugins/elasticsearch/lib/create_proxy.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
const createAgent = require('./create_agent');
const mapUri = require('./map_uri');
const { resolve } = require('url');
const { assign } = require('lodash');

function createProxy(server, method, route, config) {

const options = {
method: method,
path: createProxy.createPath(route),
config: {
timeout: {
socket: server.config().get('elasticsearch.requestTimeout')
}
},
handler: {
proxy: {
mapUri: mapUri(server),
Expand All @@ -18,7 +24,7 @@ function createProxy(server, method, route, config) {
},
};

if (config) options.config = config;
assign(options.config, config);

server.route(options);
};
Expand Down

0 comments on commit c91a17e

Please sign in to comment.