473,799 Members | 2,842 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 2181
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
15938
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
1709
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
2935
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
11828
by: JuHui | last post by:
how to use httplib.HTTPConnection with http proxy?
11
12338
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
4075
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
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
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...
0
10259
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10030
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
9077
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
7570
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...
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.