Skip to content

Instantly share code, notes, and snippets.

@davidstrauss
Created August 4, 2015 21:05
Show Gist options
  • Save davidstrauss/64c4ee41ff81279c96ce to your computer and use it in GitHub Desktop.
Save davidstrauss/64c4ee41ff81279c96ce to your computer and use it in GitHub Desktop.
<?php
if (!defined(CURLOPT_RESOLVE)) {
define('CURLOPT_RESOLVE', 10203);
}
$gateway_port = '443';
$gateway_ip = '140.211.10.16';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://drupal.org/');
curl_setopt($ch, CURLOPT_RESOLVE, array('drupal.org:' . $gateway_port . ':' . $gateway_ip));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment