Skip to content

Commit

Permalink
feat: added ability to pass custom proxy options
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Jul 30, 2020
1 parent e3cb6d1 commit f0585f3
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 110 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const parse = require('url-parse');
const proxyWrap = require('findhit-proxywrap');
const { boolean } = require('boolean');

const proxiedHttp = proxyWrap.proxy(http);

class ProxyServer {
constructor(config) {
this.config = {
Expand All @@ -24,9 +22,12 @@ class ProxyServer {
// useful option if you don't need https redirect
// (e.g. it's just a certbot server)
redirect: true,
// <https://github.com/cusspvz/proxywrap>
proxyOptions: {},
...config
};

const proxiedHttp = proxyWrap.proxy(http, this.config.proxyOptions);
const router = new Router();

// support for lets encrypt verification
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"devDependencies": {
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"ava": "^3.10.1",
"codecov": "^3.7.1",
"ava": "^3.11.0",
"codecov": "^3.7.2",
"cross-env": "^7.0.2",
"eslint": "^7.5.0",
"eslint-config-xo-lass": "^1.0.3",
Expand All @@ -40,7 +40,7 @@
"lint-staged": "^10.2.11",
"nyc": "^15.1.0",
"remark-cli": "^8.0.1",
"remark-preset-github": "^2.0.2",
"remark-preset-github": "^3.0.0",
"sinon": "^9.0.2",
"supertest": "^4.0.2",
"xo": "^0.32.1"
Expand Down
Loading

0 comments on commit f0585f3

Please sign in to comment.