Ignore:
Timestamp:
Jan 9, 2009, 11:50:54 AM (16 years ago)
Author:
quentin
Message:

Support listening on a particular interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/vnc-client/invirt-vnc-client

    r1972 r1973  
    1111 -l, --listen [HOST:]PORT  port (and optionally host) to listen on for
    1212                           connections (default is 127.0.0.1 and a randomly
    13                            chosen port)
     13                           chosen port). Use an empty HOST to listen on all
     14                           interfaces (INSECURE!)
    1415 -a, --authtoken AUTHTOKEN Authentication token for connecting to the VNC server
    1516 VMNAME                    VM name to connect to (automatically fetches an
     
    142143            if ":" in a:
    143144                listen = a.split(":", 2)
     145                listen[1] = int(listen[1])
    144146            else:
    145                 listen[1] = a
     147                listen[1] = int(a)
    146148        elif o in ("-a", "--authtoken"):
    147149            authtoken = a
     
    191193        listen[1] = 5900
    192194        ready = False
    193         while not ready:
     195        while not ready and listen[1] < 6000:
    194196            try:
    195                 reactor.listenTCP(listen[1], ProxyFactory(connect_host, connect_port, authtoken, machine))
     197                reactor.listenTCP(listen[1], ProxyFactory(connect_host, connect_port, authtoken, machine), interface=listen[0])
    196198                ready = True
    197199            except error.CannotListenError:
Note: See TracChangeset for help on using the changeset viewer.