root/trunk/twisted/tap/portforward.py

Revision 25168, 0.7 KB (checked in by exarkun, 22 months ago)

Merge remove-mktap-3393

Author: kehander1, exarkun
Reviewer: ralphm, itamar
Fixes: #3393

Remove almost all references to mktap(1) from the Twisted documentation.

The finger tutorial still refers to mktap since it also contains an
old-style plugin which will not work with twistd.

Line 
1
2# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
3# See LICENSE for details.
4
5"""
6Support module for making a port forwarder with twistd.
7"""
8from twisted.protocols import portforward
9from twisted.python import usage
10from twisted.application import strports
11
12class Options(usage.Options):
13    synopsis = "[options]"
14    longdesc = 'Port Forwarder.'
15    optParameters = [
16          ["port", "p", "6666","Set the port number."],
17          ["host", "h", "localhost","Set the host."],
18          ["dest_port", "d", 6665,"Set the destination port."],
19    ]
20    zsh_actions = {"host" : "_hosts"}
21
22def makeService(config):
23    f = portforward.ProxyFactory(config['host'], int(config['dest_port']))
24    return strports.service(config['port'], f)
Note: See TracBrowser for help on using the browser.