4 messages in com.googlegroups.bloggerdevCURL/PHP: Using Proxies when posting.
FromSent OnAttachments
Hidden_Frame20 Jun 2007 21:54 
Pete Hopkins ☠27 Jun 2007 12:14 
面窝28 Jun 2007 23:03 
面窝28 Jun 2007 23:19 
Subject:CURL/PHP: Using Proxies when posting.
From:Hidden_Frame (cana@gmail.com)
Date:06/20/2007 09:54:23 PM
List:com.googlegroups.bloggerdev

I have a problem in that my work blocks all sorts of websites; and for some reason blogger is one of them. On the bright side, they let me use my laptop so I hacked together a little application to let me post while at work through a proxy server I setup on my static IP connection at home. Unfortunately, it doesn't actually let me post : ( It give me this error message:

"Received HTTP code 403 from proxy after CONNECT"

At home, without the proxy-related lines, it works perfectly. (That is to say, without curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); and curl_setopt($ch, CURLOPT_PROXY, "$proxyurl"); )

The relevant code is below:

$auths = explode("\n", $output); $auth = trim($auths[2]); echo '<br />' . $auth; $authheader = "GoogleLogin $auth";

// Set the date of your post $issued=gmdate("Y-m-d\TH:i:s\Z", time());

// This is the custom header that needs to be sent to post to your blog. $headers = array( "Content-type: application/atom+xml" , "Authorization: GoogleLogin $auth" );

// Use curl to post to your blog. curl_setopt($ch, CURLOPT_URL, "$blogposturl"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $content); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); curl_setopt($ch, CURLOPT_PROXY, "$proxyurl");

$data = curl_exec($ch);

if (curl_errno($ch)) { print curl_error($ch); } else { echo $data; curl_close($ch); }

Does google prevent proxy connections using CURL? I also use the proxy to get the AUTH code, and it seems to work just fine :/

Before anyone asks, I can also surf to one of those shady proxy servers online and post through that, but it seems like a huge security risk :/