2
# Twisted, the Framework of Your Internet
3
# Copyright (C) 2001 Matthew W. Lefkowitz
5
# This library is free software; you can redistribute it and/or
6
# modify it under the terms of version 2.1 of the GNU Lesser General Public
7
# License as published by the Free Software Foundation.
9
# This library is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
# Lesser General Public License for more details.
14
# You should have received a copy of the GNU Lesser General Public
15
# License along with this library; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
I am the support module for making a stupid proxy with mktap.
22
from twisted.internet import tcp, stupidproxy
23
from twisted.python import usage
27
class Options(usage.Options):
28
synopsis = "Usage: mktap stupid [options]"
30
optStrings = [["port", "p", 6666,"Set the port number."],
31
["host", "h", "localhost","Set the host."],
32
["dest_port", "d", 6665,"Set the destination port."]]
34
longdesc = 'Stupid proxy.'
36
def updateApplication(app, config):
37
s = stupidproxy.makeStupidFactory(config.host, int(config.dest_port))
38
app.listenTCP(int(config.port), s)