Пример #1
0
def test_DoS(client_class_constructor, args):
    """ utility method for running DoS tests
        See: test_DoS_*_client.py
    """

    assert len(args)==2, "usage: test_DoS_client :DISPLAY"
    import socket
    from xpra.dotxpra import DotXpra
    from xpra.bytestreams import SocketConnection
    import logging
    logging.root.setLevel(logging.DEBUG)
    logging.root.addHandler(logging.StreamHandler(sys.stderr))
    opts = AdHocStruct()
    opts.password_file = ""
    opts.encoding = "rgb24"
    opts.jpegquality = 0
    display = sys.argv[1]
    target = DotXpra().socket_path(display)
    print("will attempt to connect to socket: %s" % target)
    sock = socket.socket(socket.AF_UNIX)
    sock.connect(target)
    conn = SocketConnection(sock)
    print("socket connection=%s" % conn)
    app = client_class_constructor(conn, opts)
    try:
        app.run()
    finally:
        app.cleanup()
    print("ended")
    print("")
Пример #2
0

from wimpiggy.util import AdHocStruct
xpra_opts = AdHocStruct()
xpra_opts.encoding = default_str("encoding", DEFAULT_ENCODING,
                                 ENCODING_OPTIONS)
xpra_opts.jpegquality = default_int("jpegquality", 90)
xpra_opts.host = defaults.get("host", "127.0.0.1")
xpra_opts.port = default_int("port", 10000)
xpra_opts.mode = default_str("mode", "tcp", ["tcp", "ssh"])
xpra_opts.debug = default_bool("debug", False)
xpra_opts.no_tray = default_bool("debug", False)
xpra_opts.dock_icon = default_str("dock-icon", "")
xpra_opts.tray_icon = default_str("tray-icon", "")
xpra_opts.window_icon = default_str("window-icon", "")
xpra_opts.password_file = default_str("password-file", "")
xpra_opts.clipboard = default_bool("clipboard", True)
xpra_opts.pulseaudio = default_bool("pulseaudio", True)
xpra_opts.mmap = default_bool("mmap", True)
xpra_opts.mmap_group = default_bool("mmap-group", False)
xpra_opts.readonly = default_bool("readonly", False)
xpra_opts.keyboard_sync = default_bool("keyboard-sync", True)
xpra_opts.compression_level = default_int("compression", 3)
xpra_opts.send_pings = default_bool("pings", False)
xpra_opts.dpi = default_int("dpi", 96)
xpra_opts.cursors = default_bool("cursors", True)
xpra_opts.bell = default_bool("bell", True)
xpra_opts.notifications = default_bool("notifications", True)
xpra_opts.sharing = default_bool("sharing", False)
xpra_opts.delay_tray = default_bool("delay-tray", False)
#these would need testing/work:
Пример #3
0
XPRA_COMPRESSION_OPTIONS_DICT = {LOSSY_5 : 5,
						LOSSY_20 : 20,
						LOSSY_50 : 50,
						LOSSY_90 : 90
						}

# Default connection options
from wimpiggy.util import AdHocStruct
xpra_opts = AdHocStruct()
xpra_opts.encoding = "jpeg"
xpra_opts.jpegquality = 90
xpra_opts.host = "127.0.0.1"
xpra_opts.port = 16010
xpra_opts.mode = "tcp"
xpra_opts.autoconnect = False
xpra_opts.password_file = False

class ApplicationWindow:

	def	__init__(self):
		self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
		self.window.connect("destroy", self.destroy)
		self.window.set_default_size(400, 300)
		self.window.set_border_width(20)

		# Title
		vbox = gtk.VBox(False, 0)
		vbox.set_spacing(15)
		label = gtk.Label("Connect to xpra server")
		label.modify_font(pango.FontDescription("sans 13"))
		vbox.pack_start(label)
Пример #4
0
	v = defaults.get(varname)
	return str_to_bool(v, default_value)

from wimpiggy.util import AdHocStruct
xpra_opts = AdHocStruct()
xpra_opts.encoding = default_str("encoding", DEFAULT_ENCODING, ENCODING_OPTIONS)
xpra_opts.jpegquality = default_int("jpegquality", 90)
xpra_opts.host = defaults.get("host", "127.0.0.1")
xpra_opts.port = default_int("port", 10000)
xpra_opts.mode = default_str("mode", "tcp", ["tcp", "ssh"])
xpra_opts.debug = default_bool("debug", False)
xpra_opts.no_tray = default_bool("debug", False)
xpra_opts.dock_icon = default_str("dock-icon", "")
xpra_opts.tray_icon = default_str("tray-icon", "")
xpra_opts.window_icon = default_str("window-icon", "")
xpra_opts.password_file = default_str("password-file", "")
xpra_opts.clipboard = default_bool("clipboard", True)
xpra_opts.pulseaudio = default_bool("pulseaudio", True)
xpra_opts.mmap = default_bool("mmap", True)
xpra_opts.mmap_group = default_bool("mmap-group", False)
xpra_opts.readonly = default_bool("readonly", False)
xpra_opts.keyboard_sync = default_bool("keyboard-sync", True)
xpra_opts.compression_level = default_int("compression", 3)
xpra_opts.send_pings = default_bool("pings", False)
xpra_opts.dpi = default_int("dpi", 96)
xpra_opts.cursors = default_bool("cursors", True)
xpra_opts.bell = default_bool("bell", True)
xpra_opts.notifications = default_bool("notifications", True)
#these would need testing/work:
xpra_opts.auto_refresh_delay = 0.0
xpra_opts.max_bandwidth = 0.0
Пример #5
0
}

# Default connection options
from wimpiggy.util import AdHocStruct
xpra_opts = AdHocStruct()
xpra_opts.encoding = "png"
xpra_opts.jpegquality = 90
xpra_opts.host = "127.0.0.1"
xpra_opts.port = 16010
xpra_opts.mode = "tcp"
xpra_opts.debug = False
xpra_opts.autoconnect = False
xpra_opts.no_tray = False
xpra_opts.dock_icon = ""
xpra_opts.tray_icon = ""
xpra_opts.password_file = False
xpra_opts.clipboard = True
xpra_opts.pulseaudio = True
xpra_opts.mmap = True
xpra_opts.readonly = False
xpra_opts.keyboard_sync = True
xpra_opts.compression_level = 3
xpra_opts.auto_refresh_delay = 0.0
xpra_opts.max_bandwidth = 0.0
xpra_opts.window_icon = ""
xpra_opts.key_shortcuts = ["Meta+Shift+F4:quit"]
xpra_opts.password_file = ""
xpra_opts.send_pings = False


def get_icon_from_file(filename):
Пример #6
0
		self.info.set_text("Connection established")
		try:
			from xpra.protocol import SocketConnection
			global socket_wrapper
			socket_wrapper = SocketConnection(sock)
		except Exception, e:
			self.info.set_text("Xpra Client error: %s" % e)
			return
		self.window.hide()
		# launch Xpra client in the same gtk.main():
		from wimpiggy.util import gtk_main_quit_on_fatal_exceptions_enable, AdHocStruct
		gtk_main_quit_on_fatal_exceptions_enable()
		opts = AdHocStruct()
		opts.clipboard = True
		opts.pulseaudio = True
		opts.password_file = None
		opts.title_suffix = None
		opts.title = "@title@ on @client-machine@"
		opts.encoding = "rgb24"
		opts.jpegquality = 80
		opts.max_bandwidth = 0.0
		opts.auto_refresh_delay = 0.0
		opts.key_shortcuts = []
		opts.compression_level = 3
		from xpra.platform import DEFAULT_SSH_CMD
		opts.ssh = DEFAULT_SSH_CMD
		opts.remote_xpra = ".xpra/run-xpra"
		opts.debug = None
		opts.dock_icon = None
		
		import logging
Пример #7
0
						}

# Default connection options
from wimpiggy.util import AdHocStruct
xpra_opts = AdHocStruct()
xpra_opts.encoding = "png"
xpra_opts.jpegquality = 90
xpra_opts.host = "127.0.0.1"
xpra_opts.port = 16010
xpra_opts.mode = "tcp"
xpra_opts.debug = False
xpra_opts.autoconnect = False
xpra_opts.no_tray = False
xpra_opts.dock_icon = ""
xpra_opts.tray_icon = ""
xpra_opts.password_file = False
xpra_opts.clipboard = True
xpra_opts.pulseaudio = True
xpra_opts.mmap = True
xpra_opts.readonly = False
xpra_opts.keyboard_sync = True
xpra_opts.compression_level = 3
xpra_opts.auto_refresh_delay = 0.0
xpra_opts.max_bandwidth = 0.0
xpra_opts.window_icon = ""
xpra_opts.key_shortcuts = ["Meta+Shift+F4:quit"]
xpra_opts.password_file = ""
xpra_opts.send_pings = False


Пример #8
0
        self.info.set_text("Connection established")
        try:
            from xpra.protocol import SocketConnection
            global socket_wrapper
            socket_wrapper = SocketConnection(sock)
        except Exception, e:
            self.info.set_text("Xpra Client error: %s" % e)
            return
        self.window.hide()
        # launch Xpra client in the same gtk.main():
        from wimpiggy.util import gtk_main_quit_on_fatal_exceptions_enable, AdHocStruct
        gtk_main_quit_on_fatal_exceptions_enable()
        opts = AdHocStruct()
        opts.clipboard = True
        opts.pulseaudio = True
        opts.password_file = None
        opts.title_suffix = None
        opts.title = "@title@ on @client-machine@"
        opts.encoding = "rgb24"
        opts.jpegquality = 80
        opts.max_bandwidth = 0.0
        opts.auto_refresh_delay = 0.0
        opts.key_shortcuts = []
        opts.compression_level = 3
        from xpra.platform import DEFAULT_SSH_CMD
        opts.ssh = DEFAULT_SSH_CMD
        opts.remote_xpra = ".xpra/run-xpra"
        opts.debug = None
        opts.dock_icon = None

        import logging