serpapi-javascript icon indicating copy to clipboard operation
serpapi-javascript copied to clipboard

Feature Request: Support HTTPS_PROXY / HTTP_PROXY / NO_PROXY environment variables for proxying

Open sondt2709 opened this issue 9 months ago • 2 comments

Hi SerpApi team 👋,

I’m using serpapi-javascript in a Dockerized Node.js environment where external network traffic must go through a corporate proxy.

Currently, it appears that the library does not respect standard environment variables like HTTPS_PROXY, HTTP_PROXY, and NO_PROXY. From reviewing the source, it looks like the underlying https module is used directly, which doesn’t automatically inherit proxy settings from the environment.

Expected Behavior

The library should support proxy configuration via environment variables, similar to how tools like axios, got, or node-fetch behave.

Feature Request

Would you consider adding proxy support either via: • Native support for HTTPS_PROXY/HTTP_PROXY/NO_PROXY in the client • Or, allowing users to pass a custom HTTP(S) agent when initializing the SerpApi client?

Thanks for considering this!

sondt2709 avatar Mar 26 '25 12:03 sondt2709

Thank you @sondt2709 for this request. Makes sense.

@zyc9012 @Freaky Is this something we would consider adding? Tagging you two since you're the ones who most recently touched this code

alexbarron avatar Mar 26 '25 14:03 alexbarron

@sondt2709 Thank you for the request. We will work on this soon.

zyc9012 avatar Apr 02 '25 01:04 zyc9012