Skip to content

Commit

Permalink
feat: Support HTTPS or HTTP service URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
orangejulius committed Jul 16, 2021
1 parent 5294830 commit f07e7af
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

const http = require('http');
const https = require('https');
const request = require('superagent');
const _ = require('lodash');

Expand Down Expand Up @@ -49,8 +48,10 @@ module.exports = function setup(serviceConfig) {

logger.info(`using ${serviceConfig.getName()} service at ${serviceConfig.getBaseUrl()}`);

const connection_library = serviceConfig.getBaseUrl().startsWith('https') ? https : http;

// create one HTTP agent with keep alives enabled per service instance
const agent = new http.Agent({
const agent = new connection_library.Agent({
keepAlive: true
});

Expand Down

0 comments on commit f07e7af

Please sign in to comment.