-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No support for setting up proxy server #21
Comments
Hey @lanzer-gaia Can you elaborate a bit on the problem you're seeing? I want to make sure I understand the disconnect between setting the proxy and the underlying client using the value properly, or why you'd be interested in directly controlling the SDK's HTTP client. |
Sure thing. Some servers out there sit inside a firewall and have no external IP address for security reasons. A load balancer will direct external traffic to those servers and they have no problem responding to those clients as the TCP connection had already been setup. Those servers cannot initiate outgoing connections to the Internet for security reasons, and any applications must route outgoing requests through a proxy server which grants or deny access based on our access control list. It's kind of like having a default gateway, except the gateway is a firewall and is specified on the application layer instead of automatically handled by the operating system's networking layer. More information on SOCKS proxy server When using CURL in PHP all you need to do is to specify the IP address and port number of the proxy server you're using: Pretty much any HTTP libraries for PHP will have support for proxy servers, including Unirest which the PayPal-PHP-Server-SDK uses. You can setup proxy as per their doc at (https://github.com/Kong/unirest-php?tab=readme-ov-file#proxy): I just manually specified the config in the Paypal Client. Though currently the Paypal server SDK client builder already support most of the Unirest\Configuration options such as timeout, enableRetries, retryInterval, etc. We just need proxy and proxyAuth to be added. (/apimatic/unirest-php/src/Configuration.php line 284 & 300) |
See #13 |
Ah, I see. I had mistakenly thought that the Client/Client Builder had the ability to set the proxy but it appears I was quite mistaken. There definitely does not appear to be a setter/config opt for proxies, which yeah, would present a problem for your (and most) setups. Let me see what we can do to get this added to the client and exposed the right way. |
We have our web servers behind a load balancer and all outgoing calls are routed through a proxy server.
It's easy enough to manually specify the proxy parameter in PaypalServerSdkClient on line 61, but it would be good for the SDK to allow overriding the config options for the Apimatic UniRest client builder.
The text was updated successfully, but these errors were encountered: