2004-05-02, v keltezéssel 10:47-kor Hegedüs Ervin ezt írta:
hello,
adott egy szerver, localhoston figyel az httpd, egy Zorp 2.0.2 vedi (transzparens mod nelkul)
szeretnek egy https kapcsolatot proxyzni oly modon, h a Zorp es a httpd kozott nincs titkositas, csak a kliens-Zorp kozott.
Az alabbi konfigot hasznalom:
from Zorp.Core import * from Zorp.Plug import * from Zorp.Http import * from Zorp.Ftp import * from Zorp.Pssl import *
from socket import gethostbyaddr
... # ez az osztaly nativ HTTP eseten mar mukodik class MyHTTP(HttpProxy): def config(self): HttpProxy.config(self); try: RemoteHost = gethostbyaddr (self.session.client_address.ip_s)[0]; except: RemoteHost = self.session.client_address.ip_s;
self.request_headers["X-Host"] = (HTTP_HDR_INSERT, RemoteHost) self.session.server_address = SockAddrInet("127.0.0.1", 80)
def setServerAddress(self, host, port): self.session.setServer (SockAddrInet('127.0.0.1', 80))
a'm 9-es debuggal az alabbi eredmenyt kapom: (a dump infokat nem copyztam be...)
zorp_https[8005]: (zorp@site/https:0/pssl): calling __startup__() event; zorp_https[8005]: (zorp@site/https:0/pssl): calling startUp() event; zorp_https[8001]: (Log thread): Traceback (most recent call last): zorp_https[8001]: (Log thread): File "/usr/local/share/zorp/pylib/Zorp/Proxy.py", line 248, in connectServer zorp_https[8005]: (zorp@site/https:0/pssl): calling __destroy__() event; zorp_https[8005]: (zorp@site/https:0/pssl): Proxy destroy; class='MyHTTPS', module='pssl' zorp_https[8005]: (zorp@site/https:0/pssl/client): Shutdown channel; fd='17', mode='2' zorp_https[8005]: (zorp@site/https:0/pssl/client): Closing channel; fd='17' zorp_https[8005]: (zorp@site/https:0/pssl): Proxy ending; class='MyHTTPS', module='pssl' zorp_https[8005]: (zorp@site/https:0/pssl/client): accounting info; type='stream', duration='0', sent='0', received='0' zorp_https[8005]: (zorp@site/https:0/pssl): thread exiting; zorp_https[8001]: (Log thread): self.session.chainer.chainParent(self.session) zorp_https[8001]: (Log thread): File "/usr/local/share/zorp/pylib/Zorp/Chainer.py", line 181, in chainParent zorp_https[8001]: (Log thread): remote = session.server_address.clone(0) zorp_https[8001]: (Log thread): AttributeError: 'None' object has no attribute 'clone'
hmm.. a session.server_address valamiert nem allitodik be, lehet, hogy a fenti konfigban a setServerAddress metodus valoban igy van indentalva, vagy csak a levelben nem jo? szerintem ha nem muszaly a setServerAddress-hez ne nyulj, hanem inkabb InbandRouter helyett hasznalj DirectedRouter-t. -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1