Ticket #2125: command line options.patch
File command line options.patch, 6.3 KB (added by , 3 years ago) |
---|
-
trunk/src/xpra/scripts/config.py
586 586 "swap-keys" : bool, 587 587 "start-new-commands": bool, 588 588 "proxy-start-sessions": bool, 589 "proxy-allow-register": bool, 589 590 "desktop-fullscreen": bool, 590 591 "global-menus" : bool, 591 592 "forward-xdg-open" : bool, … … 623 624 "bind-ssl" : list, 624 625 "bind-ssh" : list, 625 626 "bind-rfb" : list, 627 "register" : list, 626 628 "auth" : list, 627 629 "vsock-auth" : list, 628 630 "tcp-auth" : list, … … 651 653 "start-on-connect", "start-child-on-connect", 652 654 "start-on-last-client-exit", "start-child-on-last-client-exit", 653 655 ] 654 BIND_OPTIONS = ["bind", "bind-tcp", "bind-udp", "bind-ssl", "bind-ws", "bind-wss", "bind-vsock", "bind-rfb" ]656 BIND_OPTIONS = ["bind", "bind-tcp", "bind-udp", "bind-ssl", "bind-ws", "bind-wss", "bind-vsock", "bind-rfb", "register"] 655 657 656 658 #keep track of the options added since v1, 657 659 #so we can generate command lines that work with older supported versions: … … 979 981 "exit-with-client" : False, 980 982 "start-new-commands": False, 981 983 "proxy-start-sessions": True, 984 "proxy-allow-register": False, 982 985 "av-sync" : True, 983 986 "exit-ssh" : True, 984 987 "dbus-control" : not WIN32 and not OSX, … … 1013 1016 "bind-ssl" : [], 1014 1017 "bind-ssh" : [], 1015 1018 "bind-rfb" : [], 1019 "register" : [], 1016 1020 "auth" : [], 1017 1021 "vsock-auth" : [], 1018 1022 "tcp-auth" : [], -
trunk/src/xpra/scripts/parsing.py
327 327 dest="proxy_start_sessions", default=defaults.proxy_start_sessions, 328 328 help="Allows proxy servers to start new sessions on demand." 329 329 +" 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)) 330 333 group.add_option("--dbus-launch", action="store", 331 334 dest="dbus_launch", metavar="CMD", default=defaults.dbus_launch, 332 335 help="Start the session within a dbus-launch context," … … 544 547 help="Listen for RFB connections." 545 548 + " Use --rfb-auth to secure it." 546 549 + " 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") 547 554 else: 548 555 ignore({ 549 556 "bind" : defaults.bind, … … 554 561 "bind-ssl" : defaults.bind_ssl, 555 562 "bind-ssh" : defaults.bind_ssh, 556 563 "bind-rfb" : defaults.bind_rfb, 564 "register" : defaults.register, 557 565 }) 558 566 try: 559 567 from xpra.net import vsock -
trunk/src/xpra/scripts/server.py
439 439 bind_ws = parse_bind_ip(opts.bind_ws) 440 440 bind_wss = parse_bind_ip(opts.bind_wss) 441 441 bind_rfb = parse_bind_ip(opts.bind_rfb, 5900) 442 register = parse_bind_ip(opts.register) 442 443 bind_vsock = parse_bind_vsock(opts.bind_vsock) 443 444 444 445 mdns_recs = {} … … 469 470 raise InitException("cannot create SSL socket, check your certificate paths (%s): %s" % (cpaths, e)) 470 471 471 472 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 472 479 def add_tcp_socket(socktype, host_str, iport): 473 480 if iport!=0 and iport<min_port: 474 481 error_cb("invalid %s port number %i (minimum value is %i)" % (socktype, iport, min_port)) … … 539 546 for host, iport in bind_rfb: 540 547 add_tcp_socket("rfb", host, iport) 541 548 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) 542 552 log("setting up vsock sockets: %s", csv(bind_vsock)) 543 553 for cid, iport in bind_vsock: 544 554 socket = setup_vsock_socket(cid, iport) -
trunk/src/xpra/server/proxy/proxy_server.py
58 58 ServerCore.__init__(self) 59 59 self._max_connections = MAX_CONCURRENT_CONNECTIONS 60 60 self._start_sessions = False 61 self._allow_register = False 61 62 self.session_type = "proxy" 62 63 self.main_loop = None 63 64 #proxy servers may have to connect to remote servers, … … 80 81 self.video_encoders = opts.proxy_video_encoders 81 82 self.csc_modules = opts.csc_modules 82 83 self._start_sessions = opts.proxy_start_sessions 84 self._allow_register = opts.proxy_allow_register 83 85 ServerCore.init(self, opts) 84 86 #ensure we cache the platform info before intercepting SIGCHLD 85 87 #as this will cause a fork and SIGCHLD to be emitted: