Using Proxies for HTTPS requests

236 views
Skip to first unread message

Tracy Moore

unread,
Nov 9, 2014, 8:22:02 PM11/9/14
to google-a...@googlegroups.com
I'm using urllib2 to make several HTTP and HTTPS requests. My problem is that I'm unable to make HTTPS requests through a proxy, as the GAE httplib wont allow tunneling.

Is there anyway around this?

Vinny P

unread,
Nov 13, 2014, 1:21:03 AM11/13/14
to google-a...@googlegroups.com
On Sun, Nov 9, 2014 at 7:22 PM, Tracy Moore <tracym...@gmail.com> wrote:
I'm using urllib2 to make several HTTP and HTTPS requests. My problem is that I'm unable to make HTTPS requests through a proxy, as the GAE httplib wont allow tunneling.

Is there anyway around this?


I assume you're getting NotImplementedError - HTTP CONNECT Tunnelling is not supported?

Sorry to say this, but there's no way around it. You'll have to find a different way to connect to the proxy and tell it what to retrieve - for instance, the proxy could implement a HTTP API that you could then call out to using basic urlfetch.

Another alternative is to use a Managed VM and access the proxy from there, or use a prebuilt solution such as Blockspring.

 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

Iain Wade

unread,
Nov 13, 2014, 1:30:11 AM11/13/14
to google-a...@googlegroups.com
sockets api?

https://cloud.google.com/appengine/docs/python/sockets/

See the "Making httplib use sockets" section.

--Iain

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Paul Katsen

unread,
Nov 13, 2014, 1:06:17 PM11/13/14
to google-a...@googlegroups.com
Yup - doing this with Blockspring is pretty easy. Let me know if you need any help.

Chicago, IL

Cosmin Poieană

unread,
Mar 21, 2018, 11:45:09 AM3/21/18
to Google App Engine
I've discovered some workarounds, but I'm having some other issues (at least it works ok on the deploy): https://stackoverflow.com/questions/49409783/google-app-engine-permission-denied-proxy-tunneling-on-development-server
Solution: just enable httplib sockets into the app.yaml file, but don't expect to have it working ok on the development server :).
Reply all
Reply to author
Forward
0 new messages