xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #2125: command line options.patch

File command line options.patch, 6.3 KB (added by brief, 3 years ago)
  • trunk/src/xpra/scripts/config.py

     
    586586                    "swap-keys"         : bool,
    587587                    "start-new-commands": bool,
    588588                    "proxy-start-sessions": bool,
     589                    "proxy-allow-register": bool,
    589590                    "desktop-fullscreen": bool,
    590591                    "global-menus"      : bool,
    591592                    "forward-xdg-open"  : bool,
     
    623624                    "bind-ssl"          : list,
    624625                    "bind-ssh"          : list,
    625626                    "bind-rfb"          : list,
     627                    "register"          : list,
    626628                    "auth"              : list,
    627629                    "vsock-auth"        : list,
    628630                    "tcp-auth"          : list,
     
    651653    "start-on-connect", "start-child-on-connect",
    652654    "start-on-last-client-exit", "start-child-on-last-client-exit",
    653655    ]
    654 BIND_OPTIONS = ["bind", "bind-tcp", "bind-udp", "bind-ssl", "bind-ws", "bind-wss", "bind-vsock", "bind-rfb"]
     656BIND_OPTIONS = ["bind", "bind-tcp", "bind-udp", "bind-ssl", "bind-ws", "bind-wss", "bind-vsock", "bind-rfb", "register"]
    655657
    656658#keep track of the options added since v1,
    657659#so we can generate command lines that work with older supported versions:
     
    979981                    "exit-with-client"  : False,
    980982                    "start-new-commands": False,
    981983                    "proxy-start-sessions": True,
     984                    "proxy-allow-register": False,
    982985                    "av-sync"           : True,
    983986                    "exit-ssh"          : True,
    984987                    "dbus-control"      : not WIN32 and not OSX,
     
    10131016                    "bind-ssl"          : [],
    10141017                    "bind-ssh"          : [],
    10151018                    "bind-rfb"          : [],
     1019                    "register"          : [],
    10161020                    "auth"              : [],
    10171021                    "vsock-auth"        : [],
    10181022                    "tcp-auth"          : [],
  • trunk/src/xpra/scripts/parsing.py

     
    327327                      dest="proxy_start_sessions", default=defaults.proxy_start_sessions,
    328328                      help="Allows proxy servers to start new sessions on demand."
    329329                      +" Default: %s." % enabled_str(defaults.proxy_start_sessions))
     330    group.add_option("--proxy-allow-register", action="store", metavar="yes|no",
     331                      dest="proxy_allow_register", default=defaults.proxy_allow_register,
     332                      help="Allows proxy servers to register new sessions. Default: %s." % enabled_str(defaults.proxy_allow_register))
    330333    group.add_option("--dbus-launch", action="store",
    331334                      dest="dbus_launch", metavar="CMD", default=defaults.dbus_launch,
    332335                      help="Start the session within a dbus-launch context,"
     
    544547                          help="Listen for RFB connections."
    545548                          + " Use --rfb-auth to secure it."
    546549                          + " You may specify this option multiple times with different host and port combinations")
     550        group.add_option("--register", action="append",
     551                          dest="register", default=list(defaults.register or []),
     552                          metavar="[HOST]:PORT",
     553                          help="Registers at proxy")
    547554    else:
    548555        ignore({
    549556            "bind"      : defaults.bind,
     
    554561            "bind-ssl"  : defaults.bind_ssl,
    555562            "bind-ssh"  : defaults.bind_ssh,
    556563            "bind-rfb"  : defaults.bind_rfb,
     564            "register"  : defaults.register,
    557565            })
    558566    try:
    559567        from xpra.net import vsock
  • trunk/src/xpra/scripts/server.py

     
    439439    bind_ws  = parse_bind_ip(opts.bind_ws)
    440440    bind_wss = parse_bind_ip(opts.bind_wss)
    441441    bind_rfb = parse_bind_ip(opts.bind_rfb, 5900)
     442    register = parse_bind_ip(opts.register)
    442443    bind_vsock = parse_bind_vsock(opts.bind_vsock)
    443444
    444445    mdns_recs = {}
     
    469470            raise InitException("cannot create SSL socket, check your certificate paths (%s): %s" % (cpaths, e))
    470471
    471472    min_port = int(opts.min_port)
     473    def register_at_proxy(host, port):
     474        log.error("register at proxy: %s:%s", host, port)
     475
     476
     477
     478
    472479    def add_tcp_socket(socktype, host_str, iport):
    473480        if iport!=0 and iport<min_port:
    474481            error_cb("invalid %s port number %i (minimum value is %i)" % (socktype, iport, min_port))
     
    539546    for host, iport in bind_rfb:
    540547        add_tcp_socket("rfb", host, iport)
    541548        add_mdns(mdns_recs, "rfb", host, iport)
     549    log("register: %s", csv(register))
     550    for host, iport in register:
     551        register_at_proxy(host, iport)
    542552    log("setting up vsock sockets: %s", csv(bind_vsock))
    543553    for cid, iport in bind_vsock:
    544554        socket = setup_vsock_socket(cid, iport)
  • trunk/src/xpra/server/proxy/proxy_server.py

     
    5858        ServerCore.__init__(self)
    5959        self._max_connections = MAX_CONCURRENT_CONNECTIONS
    6060        self._start_sessions = False
     61        self._allow_register = False
    6162        self.session_type = "proxy"
    6263        self.main_loop = None
    6364        #proxy servers may have to connect to remote servers,
     
    8081        self.video_encoders = opts.proxy_video_encoders
    8182        self.csc_modules = opts.csc_modules
    8283        self._start_sessions = opts.proxy_start_sessions
     84        self._allow_register = opts.proxy_allow_register
    8385        ServerCore.init(self, opts)
    8486        #ensure we cache the platform info before intercepting SIGCHLD
    8587        #as this will cause a fork and SIGCHLD to be emitted: