[zorp-hu] benazok

Gabor@schrack-seconet.hu Gabor@schrack-seconet.hu
Fri, 19 Jul 2002 13:04:06 +0200


Ezt talaltam ki: 

class Http_C(HttpProxy):
 def config(self):
   HttpProxy.config(self)
   self.transparent_mode = 1
   self.request["GET"] = (HTTP_REQ_POLICY, self.filterURL)
 def filterURL(self, method, url, version):
   debug(0, "Request: '%s %s %s'" % (method, url, version))
   if ("http://webmail.domain.hu" == url):
     self.request_url = "http://129.184.93.3/"
     return HTTP_REQ_ACCEPT
   if ("http://www.domain.hu:8080/" == url):
     debug(0, "Request2: '%s %s %s'" % (method, url, version))
     self.request_url = "http://129.184.93.2/"
     return HTTP_REQ_ACCEPT
   self.error_info = "Our firewall under construction!!"
   return HTTP_REQ_DENY 

Es ez az eredmeny: 

Jul 19 12:58:35 thewall Http[3910]: (tower.domain.hu/Http_S:4): Starting 
proxy instance; client_fd='11', 
client_address='AF_INET(194.88.xx.xx:38499)', client_zone='Zone(internet, 
0.0.0.0/0)', client_local='AF_INET(194.88.xx.xx:8080)'
Jul 19 12:58:35 thewall Http[3910]: (tower.domain.hu/Http_S:4/http): Proxy 
starting; class='Http_C', module='http'
Jul 19 12:58:35 thewall Http[3933]: (zorp/nosession): Request: 'GET 
http://www.domain.hu:8080/ HTTP/1.0'
Jul 19 12:58:35 thewall Http[3933]: (tower.domain.hu/Http_S:4/http): An 
error occurred, serving error file; 
filename='/usr/share/zorp/http/policyviolation.html'
Jul 19 12:58:35 thewall Http[3933]: (tower.domain.hu/Http_S:4/http): Proxy 
ending; class='Http_C', module='http'
Jul 19 12:58:35 thewall Http[3933]: (tower.domain.hu/Http_S:4): client: 
accounting info; duration='0', sent='607', received='330'
W 

A problemak: 

Miert nem lesz igaz a feltetel, amikor a string es az url megegyezik?
Hogyan lehetne regexp-pel ellenorizni az url-t?
Inbandrouter-rel kell tovabbkuldeni a masik ket host-nak?