Search code examples
node.jsamazon-s3knox-amazon-s3-client

Setting proxy server for connections in Knox


I am using LearnBoost/knox to connect to Amazon S3 but my machine is using a proxy server. I have set an environment variable http_proxy and https_proxy but Knox is not using that. How do you get Knox to communicate through a proxy server.


Solution

  • A pull request for proxy support has been added to Knox about 8 months ago but it hasn't made it in the latest release yet (the pull request was closed).

    If you get that code, you can use:

    var client = knox.createClient({
        key: '<api-key-here>'
      , secret: '<secret-here>'
      , bucket: 'learnboost'
      , proxy: 'your-proxy'
    });