Title: Report Problem: Internal Server Error when using Proxy
Last modified: July 24, 2024

---

# Report Problem: Internal Server Error when using Proxy

 *  Resolved [sinapars](https://wordpress.org/support/users/sinapars/)
 * (@sinapars)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/report-problem-internal-server-error-when-using-proxy/)
 * Hi Team
 * My server does not have direct access to the Internet due to security issues 
   and accesses the Internet through a proxy.
   By the following settings:[https://developer.wordpress.org/reference/classes/wp_http_proxy/](https://developer.wordpress.org/reference/classes/wp_http_proxy/)
 * This issue causes all the menus of your plugin to fail, or as in the picture 
   below, it is half loaded and error 500 is received, because some of the links
   that I will mention in the following cannot be seen by the proxy.
   [https://drive.google.com/file/d/1HaR1nOqC9Krx_KarE25x_fZ_uReao9pD/view?usp=sharing](https://drive.google.com/file/d/1HaR1nOqC9Krx_KarE25x_fZ_uReao9pD/view?usp=sharing)
 * ![](https://drive.google.com/file/d/1HaR1nOqC9Krx_KarE25x_fZ_uReao9pD/view?usp
   =sharing)
 * 
   To solve this issue, I would like to make changes in the following paths:
 *     ```wp-block-code
       vendor_prefixed\google\apiclient\src\Client.php:56change this line :const OAUTH2_TOKEN_URI = 'https://oauth2.googleapis.com/token';To:const OAUTH2_TOKEN_URI = '#';
       ```
   
 * AND in path:
 *     ```wp-block-code
       vendor_prefixed\google\auth\src\CredentialsLoader.php:32Change This line:const TOKEN_CREDENTIAL_URI = 'https://oauth2.googleapis.com/token';To:const TOKEN_CREDENTIAL_URI = '#';
       ```
   
 * Is there a way that these links can be seen by proxy with the internal settings
   of WordPress?
   Or at least ask them to define a time that if it doesn’t load after
   a few seconds, the page will load and only give an error message? Because not
   seeing these links causes the entire page to fail!BR

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [David](https://wordpress.org/support/users/dpinson/)
 * (@dpinson)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/report-problem-internal-server-error-when-using-proxy/#post-17913478)
 * Hi there [@sinapars](https://wordpress.org/support/users/sinapars/),
 * Thanks for reaching out! We’re looking into this and I will update you as soon
   as I have more details. In the meantime, if you have any additional questions
   or info to add, just let me know here!
 * Thanks!
 *  [David](https://wordpress.org/support/users/dpinson/)
 * (@dpinson)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/report-problem-internal-server-error-when-using-proxy/#post-17915687)
 * Hi there [@sinapars](https://wordpress.org/support/users/sinapars/),
 * Thanks for your patience. One of our developers took a look and wrote up a code
   snippet that should help you out:
 *     ```wp-block-code
       // Add proxy settings to the Google client in the WP Mail SMTP plugin.add_filter( 'wp_mail_smtp_providers_gmail_auth_get_client_custom_options', function ( $client ) {  $proxy_scheme   = 'https'; // Change to 'http' ,'socks4' or 'tcp' if needed.  $proxy_host     = defined( 'WP_PROXY_HOST' ) ? WP_PROXY_HOST : null;  $proxy_port     = defined( 'WP_PROXY_PORT' ) ? WP_PROXY_PORT : null;  $proxy_username = defined( 'WP_PROXY_USERNAME' ) ? WP_PROXY_USERNAME : null;  $proxy_password = defined( 'WP_PROXY_PASSWORD' ) ? WP_PROXY_PASSWORD : null;  $proxy_url = null;  if ( $proxy_host && $proxy_port ) {   $proxy_url = $proxy_scheme . '://' . $proxy_host . ':' . $proxy_port;   if ( $proxy_username && $proxy_password ) {    $proxy_url = $proxy_scheme . '://' . $proxy_username . ':' . $proxy_password . '@' . $proxy_host . ':' . $proxy_port;   }  }  $httpClient = new \WPMailSMTP\Vendor\GuzzleHttp\Client( [   'proxy' => $proxy_url,  ] );  $client->setHttpClient( $httpClient );  return $client;} );
       ```
   
 * In case it helps, here’s a tutorial with the most common ways to add custom code
   like this: [https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/](https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/)
 * For the most beginner-friendly option in the guide above, I’d recommend using
   the WPCode plugin. This will protect your code from updates and keep it easy 
   to manage right within your WordPress admin area.
 * I hope that helps! Have a great day!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Report Problem: Internal Server Error when using Proxy’ is closed to 
new replies.

 * ![](https://ps.w.org/wp-mail-smtp/assets/icon-256x256.png?rev=1755440)
 * [WP Mail SMTP by WPForms - The Most Popular SMTP and Email Log Plugin](https://wordpress.org/plugins/wp-mail-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mail-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mail-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mail-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mail-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mail-smtp/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [David](https://wordpress.org/support/users/dpinson/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/report-problem-internal-server-error-when-using-proxy/#post-17915687)
 * Status: resolved