Table of contents Index
class TransparentChainer - Connect to the client's original destination.
Declared in module Chainer
Inheritance hierarchy:
Chainer.TransparentChainer
Chainer.Chainer
Synopsis
class TransparentChainer(Chainer):
def Chainer.TransparentChainer.__init__(self, local=None, forge_addr=0, forced_port=0) # Initializes a TransparentChainer instance.
def Chainer.TransparentChainer.connectServer(self, session, host, port) # Connect to the remote server.
# Inherited from Chainer.Chainer
def Chainer.Chainer.connectServer(self, session, host, port) # Connect to the targeted server.
def Chainer.Chainer.establishConnection(self, session, local, remote) # Function to actually establish the connection.
Description
This chainer connects to the destination originally addressed
by the client and intercepted by the firewall.
Attributes:
-
local
- bind address
-
forge_addr
- use client address as outgoing
local address
-
forced_port
- if not 0 force it as destination port
Usage
You have to add a redirect rule to your packet filter
configuration to force connections going through your
firewall to be serviced locally. Make sure that the Listener port is protected by a DENY
rule so that clients cannot connect to it directly, otherwise
TransparentProxy may cause an infinite loop.
Example:
Service("http", TransparentChainer(), HttpProxy)
Chainer.TransparentChainer.__init__(self, local=None, forge_addr=0, forced_port=0)
Initializes a TransparentChainer instance.
Set various attributes as passed in as parameters.
Arguments:
-
self
- this instance
-
local
- local address, may be none
-
forge_addr
- if the client address shall be forged (Optional)
-
forced_port
- use this port on the remote server (Optional)
Chainer.TransparentChainer.connectServer(self, session, host, port)
Connect to the remote server.
- self
- this instance
- session
- The data of the current session
- host
- not used
- port
- not used
Finds out the original destination of the given connection
and connects there.
Returns:
The fd given by establishConnection
Copyright © 2000 BalaBit IT Ltd.
Written by: Balázs Scheidler