Chapter 4. Python reference

Table of Contents
Module AnyPy
Module Chainer
Module Connector
Module Domain
Module Finger
Module Ftp
Module Http
Module IPChains
Module Listener
Module Plug
Module Pop3
Module Proxy
Module Pssl
Module Receiver
Module Service
Module Session
Module SockAddr
Module Stream
Module Zone
Module Zorp
Module __init__

Module AnyPy

This module defines an interface to the AnyPy proxy as implemented in Zorp. AnyPy is basically a Python proxy which means that the proxy behaviour is defined in Python by the administrator.

Imported modules

  • import Connector

    Implements classes to establish a connection.

  • import Proxy

    Module defining classes encapsulating native proxies.

  • import Service

    Module defining service related classes.

  • import Zorp

    Module defining global constants, and interface entry points to the Zorp core.

Class AnyPyProxy

This class encapsulates AnyPy, a proxy module calling a Python function to do all of its work. It can be used for defining proxies for protocols not directly supported by Zorp.

Constructor __init__

Constructor to initialize an AnyPy instance.

Synopsis

__init__ ( self,  session )

Description

This constructor initializes a new AnyPy instance based on arguments and calls the inherited constructor.

Arguments

Table 4-1. Arguments for AnyPyProxy.__init__()

self this instance
sessionsession we belong to

Method proxyThread

Function called by the low level proxy core to perform transferring requests.

Synopsis

proxyThread ( self )

Description

This function is called by the proxy module to perform transferring requests. It may use the self.session.client_stream and self.session.server_stream streams to read data from and write data to.

Arguments

Table 4-2. Arguments for AnyPyProxy.proxyThread()

selfthis instance

Exceptions

  • NotImplementedError