Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d2167032
Commit
d2167032
authored
Apr 04, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation for manual proxy configuration, by Andy Gimblett.
This closes SF patch #523415.
parent
3318792e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
Doc/lib/liburllib.tex
Doc/lib/liburllib.tex
+35
-0
No files found.
Doc/lib/liburllib.tex
View file @
d2167032
...
...
@@ -77,9 +77,17 @@ the proxy server before starting the Python interpreter. For example
...
\end{verbatim}
In a Windows environment, if no proxy envvironment variables are set,
proxy settings are obtained from the registry's Internet Settings
section.
In a Macintosh environment,
\function
{
urlopen()
}
will retrieve proxy
information from Internet
\index
{
Internet Config
}
Config.
The
\function
{
urlopen()
}
function does not support explicit proxy
specification. If you need to override environmental proxy settings,
use
\class
{
URLopener
}
, or a subclass such as
\class
{
FancyURLopener
}
.
Proxies which require authentication for use are not currently
supported; this is considered an implementation limitation.
\end{funcdesc}
...
...
@@ -195,6 +203,12 @@ define their own \mailheader{User-Agent} header by subclassing
attribute
\member
{
version
}
to an appropriate string value before the
\method
{
open()
}
method is called.
The optional
\var
{
proxies
}
parameter should be a dictionary mapping
scheme names to proxy URLs, where an empty dictionary turns proxies
off completely. Its default value is None, in which case
environmental proxy settings will be used if present, as discussed in
the definition of
\function
{
urlopen()
}
, above.
Additional keyword parameters, collected in
\var
{
x509
}
, are used for
authentication with the
\file
{
https:
}
scheme. The keywords
\var
{
key
_
file
}
and
\var
{
cert
_
file
}
are supported; both are needed to
...
...
@@ -360,3 +374,24 @@ The following example uses the \samp{POST} method instead:
>>> f = urllib.urlopen("http://www.musi-cal.com/cgi-bin/query", params)
>>> print f.read()
\end{verbatim}
The following example uses an explicitly specified HTTP proxy,
overriding environment settings:
\begin{verbatim}
>>> import urllib
>>> proxies =
{
'http': 'http://proxy.example.com:8080/'
}
>>> opener = urllib.FancyURLopener(proxies)
>>> f = opener.open("http://www.python.org")
>>> f.read()
\end{verbatim}
The following example uses no proxies at all, overriding environment
settings:
\begin{verbatim}
>>> import urllib
>>> opener = urllib.FancyURLopener(
{}
)
>>> f = opener.open("http://www.python.org/")
>>> f.read()
\end{verbatim}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment