aicommits icon indicating copy to clipboard operation
aicommits copied to clipboard

feat: Add proxy support 🏢

Open BuethSam opened this issue 1 year ago • 6 comments

My workstation is behind a corporate proxy so I implemented proxy support.

For that I had to switch to the request module.

I also added a section about the possible config option which was written almost exclusively by ChatGPT. 😅

BuethSam avatar Mar 08 '23 09:03 BuethSam

We're using the built-in http to keep the package light: https://github.com/Nutlope/aicommits/pull/106

Can you remove the request dependency?

privatenumber avatar Mar 08 '23 12:03 privatenumber

@privatenumber I used the https-proxy-agent module now to not have to reinvent the wheel. 'Import Cost' advertises it with 13.8k witch is indeed much better to the about 750k of 'request'. Yes still a dependency but much smaller.

BuethSam avatar Mar 09 '23 07:03 BuethSam

That's fine. Thank you.

Can you also update it so it's passed in via config instead of the env var?

privatenumber avatar Mar 09 '23 08:03 privatenumber

@privatenumber The proxy agent is now using a config option instead of the environment variable. I also added a section about the config options to the README

BuethSam avatar Mar 10 '23 09:03 BuethSam

Would you mind pulling in the latest develop? Sorry for the conflicts!

I added tests so we can be more confident about changes.

privatenumber avatar Mar 10 '23 14:03 privatenumber

I guess we also need to support the http_proxy and https_proxy env vars:

https://github.com/Nutlope/aicommits/issues/136

privatenumber avatar Mar 12 '23 00:03 privatenumber

Will add tests in a followup PR

privatenumber avatar Mar 27 '23 06:03 privatenumber

😍Thanks using it daily now

BuethSam avatar Mar 27 '23 12:03 BuethSam