godong9 / solr-node

Simple Solr Node Client Project.
MIT License
25 stars 25 forks source link

Allow custom agent #79

Open fabiob opened 5 years ago

fabiob commented 5 years ago

Sometimes we need to customize the agent used to communicate with Solr. In my specific use case, I need to enable HTTP keep-alive, but I can think of other uses.

The custom agent could be specified when creating the client:

var client = new SolrNode({
    host: '127.0.0.1',
    port: '8983',
    core: 'test',
    protocol: 'http',
    agent: new https.Agent({ keepAlive: true })
});
ted-lee commented 5 years ago

I need this feature, too