Skip to content
This repository was archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Adding support for request timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed Jan 20, 2015
1 parent 89e082b commit 382227a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"grunt-s3": "~0.2.0-alpha.3",
"grunt-saucelabs": "~8.3.2",
"html-entities": "^1.1.1",
"http-proxy": "~1.1.4",
"http-proxy": "~1.8.1",
"husky": "~0.6.0",
"istanbul": "~0.2.4",
"load-grunt-config": "~0.7.0",
Expand Down
6 changes: 4 additions & 2 deletions src/server/routes/proxy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
var logger = require('../lib/logger');
var express = require('express');
var router = module.exports = express.Router();
var httpProxy = require('http-proxy');
var config = require('../config');
var url = require('url');
var target = url.parse(config.elasticsearch);
var proxy = new httpProxy.createProxyServer();
var proxy = new httpProxy.createProxyServer({});
var buffer = require('buffer');

proxy.on('proxyReq', function (proxyReq, req, res, options) {
Expand Down Expand Up @@ -43,7 +44,8 @@ router.use(function (req, res, next) {
var options = {
target: config.elasticsearch,
secure: config.kibana.verify_ssl,
xfwd: true
xfwd: true,
timeout: (config.kibana.request_timeout) * 1000
};
proxy.web(req, res, options);
});
Expand Down

0 comments on commit 382227a

Please sign in to comment.