jeremydaly / data-api-client

A "DocumentClient" for the Amazon Aurora Serverless Data API
MIT License
446 stars 63 forks source link

add http option for local development #26

Closed cinqi closed 5 years ago

jeremydaly commented 5 years ago

Looks good. I'll merge this and make a few code styling changes.

jeremydaly commented 5 years ago

Hey @cinqi,

Thanks for bringing this to my attention and adding the pull request. After I merged it, I did some more research, and the RDSDataService has an sslEnabled switch that allows you to turn off SSL (set to true by default). I like to keep parity with SDK params if possible, so I changed it to this instead. Still works the same way, you just need to set sslEnabled: false in order to support your use case.

Thanks again, Jeremy

cinqi commented 5 years ago

Hi!

sslEnabled is better option name.

However, in addition to setting that to false, the sslAgent should not be set in order to http to work.

With sslEnabled: false I get error Protocol "http:" not supported. Expected "https:"

If I comment out following line, everything works: AWS.config.update({ httpOptions: { agent: sslAgent } })

jeremydaly commented 5 years ago

Hmm, try setting keepAlive to false.

cinqi commented 5 years ago

Doh! Yes, that works.