Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
432be360
Kaydet (Commit)
432be360
authored
Ara 08, 2005
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[Bug #1349316] Show how to use XML-RPC through a proxy
üst
ef1b50de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
libxmlrpclib.tex
Doc/lib/libxmlrpclib.tex
+27
-0
No files found.
Doc/lib/libxmlrpclib.tex
Dosyayı görüntüle @
432be360
...
...
@@ -355,3 +355,30 @@ try:
except Error, v:
print "ERROR", v
\end{verbatim}
To access an XML-RPC server through a proxy, you need to define
a custom transport. The following example,
written by NoboNobo,
% fill in original author's name if we ever learn it
shows how:
% Example taken from http://lowlife.jp/nobonobo/wiki/xmlrpcwithproxy.html
\begin{verbatim}
import xmlrpclib, httplib
class ProxiedTransport(xmlrpclib.Transport):
def set
_
proxy(self, proxy):
self.proxy = proxy
def make
_
connection(self, host):
self.realhost = host
h = httplib.HTTP(self.proxy)
return h
def send
_
request(self, connection, handler, request
_
body):
connection.putrequest("POST", 'http://
%s%s' % (self.realhost, handler))
def send
_
host(self, connection, host):
connection.putheader('Host', self.realhost)
p = ProxiedTransport()
p.set
_
proxy('proxy-server:8080')
server = xmlrpclib.Server('http://time.xmlrpc.com/RPC2', transport=p)
print server.currentTime.getCurrentTime()
\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