# # An example of how to set the destination address/port explicitly # It work for any proxy, as it actually sets a session attribute # # All connections are redirected to 1.2.3.4:80 from Zorp.Core import * from Zorp.Http import * Zorp.firewall_name = 'zorp@example.net' InetZone("site-net", "192.168.1.0/24", outbound_services=["intra_http"], inbound_services=[]) InetZone("internet", "0.0.0.0/0", inbound_services=["*"], outbound_services=[]) class SetDest(HttpProxy): def config(self): HttpProxy.config(self) self.session.setServer(SockAddrInet('1.2.3.4', 80)) def destination(): Service("intra_http", SetDest) Listener(SockAddrInet("192.168.1.1", 50080), "intra_http")