Node.js proxy and oauth

I have a small node.js application that uses oAuth quite heavily and I came into a problem: it appears that server where I want to install it is hidden behind proxy. And now: I have to rewrite part of code to use a proxy and I have a question about approach:

I'm using node-oauth, but I believe it doesn't support proxying. I had already overridden it a bit to support fetching binary data through oAuth, but now:

  • should I clone the whole library and change it to my needs and put it inside my app
  • write oauth library by myself from scratch, or
  • is there a better way to solve this problem?

I would love to know how would you solve this problem in terms of maintenance in the future, good practices and stuff.

Not sure if you're still having this issue, but there is a fork of OAuth that supports https here.