Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / lib / python2.7 / dist-packages / twisted / tap / | server ip : 172.67.156.115 your ip : 172.69.130.103 H O M E |
Filename | /usr/lib/python2.7/dist-packages/twisted/tap/portforward.py |
Size | 795 |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:56 |
Last modified | 18-Oct-2011 18:31 |
Last accessed | 07-Jul-2025 00:23 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Support module for making a port forwarder with twistd.
"""
from twisted.protocols import portforward
from twisted.python import usage
from twisted.application import strports
class Options(usage.Options):
synopsis = "[options]"
longdesc = 'Port Forwarder.'
optParameters = [
["port", "p", "6666","Set the port number."],
["host", "h", "localhost","Set the host."],
["dest_port", "d", 6665,"Set the destination port."],
]
compData = usage.Completions(
optActions={"host": usage.CompleteHostnames()}
)
def makeService(config):
f = portforward.ProxyFactory(config['host'], int(config['dest_port']))
return strports.service(config['port'], f)