[PATCH] gvncviewer.js: allow to connect to server:port
- From: Guido Günther <agx sigxcpu org>
- To: gtk-vnc-devel List <gtk-vnc-list gnome org>
- Subject: [PATCH] gvncviewer.js: allow to connect to server:port
- Date: Sat, 13 Aug 2011 01:13:41 +0200
so one can easily check if it works with arbitrary VNC servers.
---
examples/gvncviewer.js | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/examples/gvncviewer.js b/examples/gvncviewer.js
index 0860244..4d4bf82 100755
--- a/examples/gvncviewer.js
+++ b/examples/gvncviewer.js
@@ -10,8 +10,19 @@ GVnc.util_set_debug(true);
var win = new Gtk.Window({title: "GTK-VNC with JavaScript"});
var disp = new Vnc.Display();
+var host = "localhost"
+var port = "5900"
+
+if (ARGV.length == 1) {
+ var c = ARGV[0].indexOf(':')
+ if (c > -1) {
+ host = ARGV[0].substr(0, c)
+ port = ARGV[0].substr(c+1, ARGV[0].length)
+ } else
+ host = ARGV[0]
+}
win.add(disp);
-disp.open_host("localhost", "5900");
+disp.open_host(host, port);
win.show_all();
Gtk.main();
--
1.7.5.4
[Date Prev][Date Next] [Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]