app-store-server-library-java icon indicating copy to clipboard operation
app-store-server-library-java copied to clipboard

Add proxy support to AppStoreServerAPIClient

Open Symars opened this issue 2 months ago • 2 comments

Summary

This PR adds an optional constructor to AppStoreServerAPIClient that allows users to provide a custom java.net.Proxy for outbound HTTPS connections.

Motivation

Some developers need to route App Store Server API requests through corporate proxies or debugging tools (e.g., Charles, Fiddler). This change preserves backward compatibility while enabling flexible network configuration.

Changes

  • Added constructor accepting java.net.Proxy
  • Added corresponding convenience constructor for key-based initialization

Symars avatar Oct 16 '25 03:10 Symars

Is this not already handled here? https://github.com/apple/app-store-server-library-java/pull/93

alexanderjordanbaker avatar Oct 16 '25 03:10 alexanderjordanbaker

Is this not already handled here? #93

Thank you for the review!

Our production system integrates with multiple payment and service providers. Each provider has different network requirements and often needs to be routed through a dedicated proxy for security auditing, logging, or region-specific routing.

The current implementation of AppStoreServerAPIClient relies on global JVM proxy configuration (java.net.ProxySelector or system properties such as https.proxyHost). This approach works for single-proxy environments but cannot support multiple concurrent proxies in one JVM process.

By adding an optional constructor that accepts a java.net.Proxy, this PR enables:

Per-client, per-channel proxy routing.

Independent network configurations for different service integrations.

Full backward compatibility — the existing constructors and behavior remain unchanged.

This change is minimal, safe, and improves flexibility for enterprise or multi-tenant payment systems that interact with the App Store Server API alongside other vendors.

Symars avatar Oct 16 '25 03:10 Symars