This configuration can be used for both REST-based and gRPC-based clients. The client library sets the underlying configuration parameters based on the values in this struct.
The full URI is constructed as:
{scheme}://{username}:{password}hostname}:{port}
Any empty values are omitted, except for theschemewhich defaults tohttps. If thehostnamevalue is empty, no HTTP proxy is configured.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis page details the \u003ccode\u003eProxyConfig\u003c/code\u003e class, which is used to configure HTTP proxies for both REST-based and gRPC-based clients.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eProxyConfig\u003c/code\u003e class allows setting the hostname, port, username, password, and scheme for the HTTP proxy, with HTTPS being the default scheme.\u003c/p\u003e\n"],["\u003cp\u003eThe full proxy URI is constructed using the provided scheme, username, password, hostname, and port, and empty values are omitted except for the scheme, and if the hostname is empty, no proxy is set.\u003c/p\u003e\n"],["\u003cp\u003eThe document details a constructor and modifier functions to set the various values to set the proxy, as well as functions to retrieve the set values.\u003c/p\u003e\n"],["\u003cp\u003eThis page provides documentation of versions 2.10.1 to 2.37.0-rc of \u003ccode\u003eProxyConfig\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class ProxyConfig (2.32.0)\n\nVersion 2.32.0keyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.41.0](/cpp/docs/reference/common/2.41.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.40.0](/cpp/docs/reference/common/2.40.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.39.0](/cpp/docs/reference/common/2.39.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.38.0](/cpp/docs/reference/common/2.38.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.37.0](/cpp/docs/reference/common/2.37.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.36.0](/cpp/docs/reference/common/2.36.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.35.0](/cpp/docs/reference/common/2.35.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.34.0](/cpp/docs/reference/common/2.34.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.33.0](/cpp/docs/reference/common/2.33.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.32.0](/cpp/docs/reference/common/2.32.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.31.0](/cpp/docs/reference/common/2.31.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.30.0](/cpp/docs/reference/common/2.30.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.29.0](/cpp/docs/reference/common/2.29.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.28.0](/cpp/docs/reference/common/2.28.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.27.0](/cpp/docs/reference/common/2.27.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.26.0](/cpp/docs/reference/common/2.26.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.25.1](/cpp/docs/reference/common/2.25.1/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.24.0](/cpp/docs/reference/common/2.24.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.23.0](/cpp/docs/reference/common/2.23.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.22.1](/cpp/docs/reference/common/2.22.1/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.21.0](/cpp/docs/reference/common/2.21.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.20.0](/cpp/docs/reference/common/2.20.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.19.0](/cpp/docs/reference/common/2.19.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.18.0](/cpp/docs/reference/common/2.18.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.17.0](/cpp/docs/reference/common/2.17.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.16.0](/cpp/docs/reference/common/2.16.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.15.1](/cpp/docs/reference/common/2.15.1/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.14.0](/cpp/docs/reference/common/2.14.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.13.0](/cpp/docs/reference/common/2.13.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.12.0](/cpp/docs/reference/common/2.12.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.11.0](/cpp/docs/reference/common/2.11.0/classgoogle_1_1cloud_1_1ProxyConfig)\n- [2.10.1](/cpp/docs/reference/common/2.10.1/classgoogle_1_1cloud_1_1ProxyConfig) \nThe configuration for a HTTP Proxy. \nThis configuration can be used for both REST-based and gRPC-based clients. The client library sets the underlying configuration parameters based on the values in this struct.\n\nThe full URI is constructed as:\n\n{scheme}://{username}:{password}hostname}:{port}\n\nAny empty values are omitted, except for the `scheme` which defaults to `https`. If the `hostname` value is empty, no HTTP proxy is configured.\n\nConstructors\n------------\n\n### ProxyConfig()\n\nFunctions\n---------\n\n### set_hostname(std::string) \\&\n\nModifiers.\n\n### set_hostname(std::string) \\&\\&\n\nModifiers.\n\n### set_port(std::string) \\&\n\nModifiers.\n\n### set_port(std::string) \\&\\&\n\nModifiers.\n\n### set_username(std::string) \\&\n\nModifiers.\n\n### set_username(std::string) \\&\\&\n\nModifiers.\n\n### set_password(std::string) \\&\n\nModifiers.\n\n### set_password(std::string) \\&\\&\n\nModifiers.\n\n### set_scheme(std::string) \\&\n\nModifiers.\n\n### set_scheme(std::string) \\&\\&\n\nModifiers.\n\n### hostname() const\n\nThe HTTP proxy host.\n\n### port() const\n\nThe HTTP proxy port.\n\n### username() const\n\nThe HTTP proxy username.\n\n### password() const\n\nThe HTTP proxy password.\n\n### scheme() const\n\nThe HTTP proxy scheme (http or https)."]]