Revision cf328b06 vncauthproxy/proxy.py
b/vncauthproxy/proxy.py | ||
---|---|---|
20 | 20 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
21 | 21 |
# 02110-1301, USA. |
22 | 22 |
|
23 |
DEFAULT_BIND_ADDRESS = None
|
|
24 |
DEFAULT_LPORT = 24999 |
|
23 |
DEFAULT_LISTEN_ADDRESS = None
|
|
24 |
DEFAULT_LISTEN_PORT = 24999
|
|
25 | 25 |
DEFAULT_LOG_FILE = "/var/log/vncauthproxy/vncauthproxy.log" |
26 | 26 |
DEFAULT_PID_FILE = "/var/run/vncauthproxy/vncauthproxy.pid" |
27 | 27 |
DEFAULT_CONNECT_TIMEOUT = 30 |
... | ... | |
454 | 454 |
from optparse import OptionParser |
455 | 455 |
|
456 | 456 |
parser = OptionParser() |
457 |
parser.add_option("--bind", dest="bind_address",
|
|
458 |
default=DEFAULT_BIND_ADDRESS,
|
|
459 |
metavar="ADDRESS", |
|
457 |
parser.add_option("--listen-address", dest="listen_address",
|
|
458 |
default=DEFAULT_LISTEN_ADDRESS,
|
|
459 |
metavar="LISTEN_ADDRESS",
|
|
460 | 460 |
help=("Address to listen for control connections")) |
461 |
parser.add_option( "--lport", dest="lport",
|
|
462 |
default=DEFAULT_LPORT, |
|
463 |
metavar="LPORT", |
|
461 |
parser.add_option( "--listen-port", dest="listen_port",
|
|
462 |
default=DEFAULT_LISTEN_PORT,
|
|
463 |
metavar="LISTEN_PORT",
|
|
464 | 464 |
help=("Port to listen for control connections")) |
465 | 465 |
parser.add_option("-d", "--debug", action="store_true", dest="debug", |
466 | 466 |
help="Enable debugging information") |
... | ... | |
653 | 653 |
gevent.reinit() |
654 | 654 |
|
655 | 655 |
sockets = [] |
656 |
for res in socket.getaddrinfo(opts.bind_address, opts.lport,
|
|
656 |
for res in socket.getaddrinfo(opts.listen_address, opts.listen_port,
|
|
657 | 657 |
socket.AF_UNSPEC, socket.SOCK_STREAM, 0, |
658 | 658 |
socket.AI_PASSIVE): |
659 | 659 |
af, socktype, proto, canonname, sa = res |
Also available in: Unified diff