Skip to content

Instantly share code, notes, and snippets.

@larryyangsen
Last active December 21, 2017 01:12
Show Gist options
  • Select an option

  • Save larryyangsen/c2c8f4ba656ce67693573f8c603cc2e1 to your computer and use it in GitHub Desktop.

Select an option

Save larryyangsen/c2c8f4ba656ce67693573f8c603cc2e1 to your computer and use it in GitHub Desktop.
nodejs elasticsearch.js detect http request
import elasticsearch from 'elasticsearch';
import config from '../config';
import proxy from 'proxy-agent';
const client = new elasticsearch.Client({
host: 'my.host.com',
createNodeAgent: () => proxy("http://localhost:8888")
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment