Index: deluge/ui/web/js/deluge-connections.js
===================================================================
--- deluge/ui/web/js/deluge-connections.js	(revision 5bd5db4f162b58f92defde84e7c7ca2673c6bd77)
+++ deluge/ui/web/js/deluge-connections.js	(revision e99dd03dcc3276ff00e0b2b9a6d28f22304104f5)
@@ -4,14 +4,29 @@
     
     onConnect: function(e) {
-    }
+    },
+	
+	onShow: function(window) {
+		Deluge.Client.web.get_hosts({
+			onSuccess: Deluge.Connections.onGetHosts
+		});
+	},
+	
+	onGetHosts: function(hosts) {
+		Deluge.Connections.Store.loadData(hosts);
+	}
 }
 
 Deluge.Connections.Store = new Ext.data.SimpleStore({
 	fields: [
-		{name: 'status'},
-		{name: 'host'},
-		{name: 'version'}
+		{name: 'status', mapping: 5},
+		{name: 'host', mapping: 1},
+		{name: 'port', mapping: 2},
+		{name: 'version', mapping: 6}
 	]
 });
+
+var renderHost = function(value, p, r) {
+	return value + ':' + r.data['port']
+}
 
 Deluge.Connections.Grid = new Ext.grid.GridPanel({
@@ -20,5 +35,5 @@
 	columns: [
 		{header: "Status", width: 55, sortable: true, renderer: Deluge.Formatters.plain, dataIndex: 'status'},
-		{id:'host', header: "Host", width: 150, sortable: true, renderer: Deluge.Formatters.plain, dataIndex: 'host'},
+		{id:'host', header: "Host", width: 150, sortable: true, renderer: renderHost, dataIndex: 'host'},
 		{header: "Version", width: 75, sortable: true, renderer: Deluge.Formatters.plain, dataIndex: 'version'}
 	],	
@@ -47,4 +62,7 @@
         text: _('Connect'),
         handler: Deluge.Connections.onConnect
-    }]
+    }],
+	listeners: {
+		'show': Deluge.Connections.onShow
+	}
 });
Index: deluge/ui/web/server.py
===================================================================
--- deluge/ui/web/server.py	(revision 5bd5db4f162b58f92defde84e7c7ca2673c6bd77)
+++ deluge/ui/web/server.py	(revision e99dd03dcc3276ff00e0b2b9a6d28f22304104f5)
@@ -25,4 +25,5 @@
 import os
 import sys
+import time
 import locale
 import shutil
@@ -49,5 +50,5 @@
 from deluge.log import setupLogger, LOG as _log
 from deluge.ui import common as uicommon
-from deluge.ui.client import client
+from deluge.ui.client import client, Client
 from deluge.ui.tracker_icons import TrackerIcons
 log = logging.getLogger(__name__)
@@ -65,4 +66,6 @@
 except Exception, e:
     log.error("Unable to initialize gettext/locale: %s", e)
+
+_ = gettext.gettext
 
 current_dir = os.path.dirname(__file__)
@@ -89,5 +92,21 @@
     "refresh_secs": 10
 }
+
+DEFAULT_HOST = "127.0.0.1"
+DEFAULT_PORT = 58846
+DEFAULT_HOSTS = {
+    "hosts": [(hashlib.sha1(str(time.time())).hexdigest(), DEFAULT_HOST, DEFAULT_PORT, "", "")]
+}
+
+HOSTLIST_COL_ID = 0
+HOSTLIST_COL_HOST = 1
+HOSTLIST_COL_PORT = 2
+HOSTLIST_COL_STATUS = 3
+HOSTLIST_COL_USER = 4
+HOSTLIST_COL_PASS = 5
+HOSTLIST_COL_VERSION = 6
+
 config = ConfigManager("webui06.conf", CONFIG_DEFAULTS)
+hostlist = ConfigManager("hostlist.conf.1.2", DEFAULT_HOSTS)
 
 def rpath(path):
@@ -100,5 +119,5 @@
     
     builtins = {
-        "_": gettext.gettext,
+        "_": _,
         "version": common.get_version()
     }
@@ -127,5 +146,6 @@
             "web.get_torrent_info": self.get_torrent_info,
             "web.add_torrents": self.add_torrents,
-            "web.login": self.login
+            "web.login": self.login,
+            "web.get_hosts": self.get_hosts
         }
         for entry in open(common.get_default_config_dir("auth")):
@@ -140,7 +160,6 @@
             self.local_username = username
             self.local_password = password
-        self.connect()
-    
-    def connect(self, host="localhost", username=None, password=None):
+    
+    def connect(self, host="localhost", port=58846, username=None, password=None):
         """
         Connects the client to a daemon
@@ -215,4 +234,5 @@
                 return self._exec_remote(method, params), request_id
         except Exception, e:
+            log.exception(e)
             raise JSONException(e)
     
@@ -353,5 +373,5 @@
     
     def login(self, password):
-        """
+        """Method to allow the webui to authenticate
         """
         m = hashlib.md5()
@@ -362,4 +382,52 @@
         return d
     
+    def get_hosts(self):
+        """Return the hosts in the hostlist"""
+        hosts = dict((host[0], host[:]) for host in hostlist["hosts"])
+        
+        main_deferred = Deferred()
+        def run_check():
+            if all(map(lambda x: x[5] is not None, hosts.values())):
+                main_deferred.callback(hosts.values())
+        
+        def on_connect(result, c, host_id):
+            def on_info(info, c):
+                hosts[host_id][5] = _("Online")
+                hosts[host_id][6] = info
+                c.disconnect()
+                run_check()
+            
+            def on_info_fail(reason):
+                hosts[host_id][5] = _("Offline")
+                run_check()
+            
+            d = c.daemon.info()
+            d.addCallback(on_info, c)
+            d.addErrback(on_info_fail, c)
+            
+        def on_connect_failed(reason, host_id):
+            print reason
+            hosts[host_id][5] = _("Offline")
+            run_check()
+        
+        for host in hosts.values():
+            host_id, host, port, user, password = host[0:5]
+            hosts[host_id].append(None)
+            hosts[host_id].append(None)
+            
+            if client.connected() and (host, port, user) == client.connection_info():
+                def on_info(info):
+                    hosts[host_id][6] = info
+                    run_check()
+                host[5] = _("Connected")
+                client.daemon.info().addCallback(on_info)
+                hosts[host_id] = host
+                continue
+            
+            c = Client()
+            d = c.connect(host, port, user, password)
+            d.addCallback(on_connect, c, host_id)
+            d.addErrback(on_connect_failed, host_id)
+        return main_deferred
 
 class GetText(resource.Resource):
