wttech / crex-sdk

Javascript SDK for Creative Exchange API
MIT License
10 stars 4 forks source link

implemented proxy logic, added package-lock file; #5

Closed mcarneiro closed 6 years ago

mcarneiro commented 6 years ago

Made a quick proxy implementation so I could work remotelly. Didn't update any tests or documentation, but I can say it's working. So please take a look.

Cheers

mcarneiro commented 6 years ago

related to issue #4

mateuszluczak commented 6 years ago

Hey @mcarneiro

Good stuff, can you provide the way how to use one can use the proxy so I will test and update the wiki before merging this ticket

Code seems 👌

mcarneiro commented 6 years ago

@mateuszluczak just added a proxy key inside env prop in auth.json file (basically what CrEx constuctor receives). So you could have, for example, dev.proxy with values that node-proxy-agent used by superagent-proxy accepts:

{
  "dev": {
    "user": "admin",
    "password": "123456",
    "url": "127.0.0.1",
    "port": "4000",
    "proxy": "http://18:222.0.18:3128"
  }
}

Just tested with http proxy. Made a quick try with pac file, but it didn't work. Maybe node-proxy-agent issue.