hoxy icon indicating copy to clipboard operation
hoxy copied to clipboard

Adds a setConfig option to hoxy

Open trueadm opened this issue 8 years ago • 3 comments
trafficstars

By allowing the user to setConfig, they can customise the request validProtocols, removeHeaders and nonEntityMethods with custom values.

Note: tests do not pass for me (they also fail on master), am I doing something wrong to get them working?

trueadm avatar Nov 23 '16 15:11 trueadm

Thanks for taking the time to do a PR. I'm concerned since these changes would force the same configuration on every running instance of a proxy, it could create bugs in some scenarios. For example two areas in a codebase that don't really "know" about each other, trying to set config on hoxy and conflicts arising. To the extent these things should be customizable, they should be customizable per-instance, i.e. by passing options to createServer().

var proxy = hoxy.createServer({
  ...
  validProtocols: { ... },
  removeHeaders: { ... },
  nonEntityMethods: { ... },
});

I realize it's a deeper change, but I think it would be the right thing to do.

greim avatar Nov 26 '16 19:11 greim

~~Also, regarding tests, I haven't run them on more recent versions of Node. Have you verified the test failures are happening against only your branch, or against master also?~~

Never mind, I see you mentioned that they do fail on master.

greim avatar Nov 26 '16 19:11 greim

Just pushed an update that fixed the test failures on my end. Let me know if you still run into issues.

greim avatar Nov 27 '16 21:11 greim