473,836 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

httplib throw a proxy

I'm using a library based on httplib.
Recently i've done a conversion for use of https with a key and
certificate file. This goes perfectly :-) .

Now, the problem is passing throw an http_proxy.
It seems because httplib (based on socket.py) try to autenticate on the
proxy.
I'm only with this problem ? it's impossible :-|

any ideas ?
thank's all
Glauco
Jul 18 '05 #1
2 2183
On Mon, 22 Mar 2004 12:45:28 +0100, Glauco <00*********@fa stwebnet.it> wrote:
I'm using a library based on httplib.

Now, the problem is passing throw an http_proxy.
It seems because httplib (based on socket.py) try to autenticate on the
proxy.
I'm only with this problem ? it's impossible :-|

any ideas ?


use urllib2, for example :

import urllib2

def install_proxy() :
"""initiali ze urllib2 to go through a proxy"""
proxy_support = urllib2.ProxyHa ndler(
{ 'http' : "http://username:passwd @IP_proxy:8080" ,
'ftp' : "http://username:passwd @IP_proxy:8080" } )
opener = urllib2.build_o pener(proxy_sup port)
urllib2.install _opener(opener)

Regards
Jul 18 '05 #2
F. Petitjean wrote:
On Mon, 22 Mar 2004 12:45:28 +0100, Glauco <00*********@fa stwebnet.it> wrote:
I'm using a library based on httplib.

Now, the problem is passing throw an http_proxy.
It seems because httplib (based on socket.py) try to autenticate on the
proxy.
I'm only with this problem ? it's impossible :-|

any ideas ?

use urllib2, for example :

import urllib2

def install_proxy() :
"""initiali ze urllib2 to go through a proxy"""
proxy_support = urllib2.ProxyHa ndler(
{ 'http' : "http://username:passwd @IP_proxy:8080" ,
'ftp' : "http://username:passwd @IP_proxy:8080" } )
opener = urllib2.build_o pener(proxy_sup port)
urllib2.install _opener(opener)

Regards


Hi Jean , thank's for response, but i cannot easy do change to base
library.
This is ZSI and is well structure over httplib.
My idea is to do some change at middle-level because proxy go well but
only without certification.

httplib.py
*
socket.py
Thank's again
Glauco
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
15941
by: scummer | last post by:
Hi, I am having a problem with the httplib HTTPConnection object. While I can easily send requests that don't have any payload (ie. "get"), I encounter issues if I want to post xml data. If you look at the class below, when req == 'getFreeBusyInfo' all functions perfectly, but when req == 'conflictRequest' I run into problems of the nature "400 Bad Request". As you will notice, I also tried the shorter HTTPConnection instance method...
2
1711
by: Lothar Scholz | last post by:
Hello, is it possible to get a webpage with httplib (or any other python library) through a proxy server ? Can't find anything about this in the documentation.
4
2393
by: Adrian Albisser | last post by:
Hey to everybody, im just beginning to program in python. So i was trying some function but always when i try the range function i get a error message. for number in range(1,100): print number Error---> There's an error in your program: expected an indented block
0
2940
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en
4
3716
by: michaelparkin | last post by:
Hi, Sorry to post what might seem like a trivial problem here, but its driving me mad! I have a simple https client that uses httplib to post data to a web server. When I post over http & https using curl the data is recieved by the web server with no problems.
0
1090
by: Michael Ekstrand | last post by:
In the course of my current project, I've had to deal with connecting to an HTTP server that isn't fully compliant with the HTTP requirements for chunked encodings. Rather than sending the end-of-data sentinel (0-length chunk), it just closes the connection (without even sending the CRLF at the end of the data). Because of this, using httplib would always throw nasty errors and not give me any useful data. Therefore, I've had to modify...
4
11836
by: JuHui | last post by:
how to use httplib.HTTPConnection with http proxy?
11
12342
by: Phoe6 | last post by:
Hi, The following piece of code works properly when my proxy password contains characters etc. But when my proxy password contained something like '|\/|' , the httplib incorrectly indentified it as separator. How do I resolve this issue. <code> # Proxy Address PROXY_IP = "1.1.9.8:80"
3
4077
by: rhXX | last post by:
hi all, i'm using this tutorial example import httplib h = httplib.HTTP("www.python.org") h.putrequest('GET','/index.html') h.putheader('User-Agent','Lame Tutorial Code') h.putheader('Accept','text/html')
0
10824
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10579
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10244
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7775
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6975
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5644
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3103
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.