OLD | NEW |
| (Empty) |
1 | |
2 # Copyright (c) 2001-2004 Twisted Matrix Laboratories. | |
3 # See LICENSE for details. | |
4 | |
5 """ | |
6 Support module for making a port forwarder with mktap. | |
7 """ | |
8 from twisted.protocols import portforward | |
9 from twisted.python import usage | |
10 from twisted.application import strports | |
11 | |
12 class Options(usage.Options): | |
13 synopsis = "Usage: mktap portforward [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 | |
22 def makeService(config): | |
23 f = portforward.ProxyFactory(config['host'], int(config['dest_port'])) | |
24 return strports.service(config['port'], f) | |
OLD | NEW |