การกําหนดค่าพร็อกซี
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ไลบรารีของไคลเอ็นต์ Java รองรับการตั้งค่าพร็อกซีสำหรับการเชื่อมต่อกับ API
การตั้งค่า
ไลบรารีสนับสนุนการใช้
การตั้งค่าพร็อกซีมาตรฐานสำหรับ Java
สำหรับพร็อกซี HTTPS ให้ตั้งค่าการกำหนดค่าพร็อกซีเป็น
-Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT
สำหรับพร็อกซี HTTP (ไม่แนะนำเว้นแต่คุณจะระบุปลายทาง HTTP ของคุณเอง)
กำหนดค่าพร็อกซีเป็น
-Dhttp.proxyHost=HOST -Dhttp.proxyPort=PORT
คุณสามารถกำหนดค่าทั้งพร็อกซี HTTP และ HTTPS ขณะรันไทม์ได้
System.setProperty("https.proxyHost", HOST);
System.setProperty("https.proxyPort", PORT);
หากคุณเปลี่ยนการตั้งค่านี้ คุณต้องสร้างไคลเอ็นต์บริการที่มีให้อีกครั้ง
โดย GoogleAdsClient.getVersionX().createYServiceClient()
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-21 UTC
[null,null,["อัปเดตล่าสุด 2025-08-21 UTC"],[[["\u003cp\u003eThe Java client library enables connections to the API through proxy settings, utilizing standard Java proxy configurations.\u003c/p\u003e\n"],["\u003cp\u003eFor HTTPS proxy connections, use \u003ccode\u003e-Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT\u003c/code\u003e, while HTTP proxy (less secure) uses \u003ccode\u003e-Dhttp.proxyHost=HOST -Dhttp.proxyPort=PORT\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eBoth HTTP and HTTPS proxy settings can be dynamically configured at runtime using \u003ccode\u003eSystem.setProperty()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAny changes to the proxy settings require recreating service clients via \u003ccode\u003eGoogleAdsClient.getVersionX().createYServiceClient()\u003c/code\u003e to apply the new configuration.\u003c/p\u003e\n"]]],[],null,["# Proxy configuration\n\nThe Java client library supports proxy settings for connecting to the API.\n\nSettings\n--------\n\nThe library supports using the\n[standard proxy settings for Java](//docs.oracle.com/en/java/javase/12/docs/api/java.base/java/net/doc-files/net-properties.html).\n\nFor HTTPS proxy set the proxy configuration as: \n\n -Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT\n\nFor HTTP proxy (not recommended unless you're providing your own HTTP endpoint),\nset the proxy configuration as: \n\n -Dhttp.proxyHost=HOST -Dhttp.proxyPort=PORT\n\nIt is possible to configure both HTTP and HTTPS proxy at runtime. \n\n System.setProperty(\"https.proxyHost\", HOST);\n System.setProperty(\"https.proxyPort\", PORT);\n\nIf you change this setting then you must recreate any service clients provided\nby `GoogleAdsClient.getVersionX().createYServiceClient()`."]]