class HTTPConnection(object):
    """
    Connection to a solr server or several ones

    :param server: The server. Can be a single one or a list of servers
                    Example: `localhost:8983` or ``[localhost,solr1.domain.com:8983]``
    """
    def __init__(self,server="localhost:8983"):
        if type(server) == type(''):
            self.url = "http://%s/solr/" % server
            self.servers = [self.url,self.url]
        if type(server) == type([]):
            self.servers = ["http://%s/solr/" % a for a in server]
        

@@ -1,8 +1,35 @@
+import urllib%0Aimport json%0A%0A
 class HT
@@ -125,16 +125,26 @@
  server:
+          
  The ser
@@ -189,16 +189,26 @@
 servers%0A
+          
         
@@ -285,16 +285,261 @@
 :8983%5D%60%60
+%0A%0A    :param detect_live_nodes : whether to detect live nodes automativally or not. This assumes %0A                               that one is able to access the IPs listed by Zookeeper.%0A                               The default value is %60Falsse%60
 %0A    %22%22%22
@@ -584,16 +584,40 @@
 st:8983%22
+,detect_live_nodes=False
 ):%0A     
@@ -702,37 +702,32 @@
 ver%0A            
-self.
 servers = %5Bself.
@@ -740,16 +740,138 @@
 lf.url%5D%0A
+            if detect_live_nodes:%0A                url = servers%5B0%5D%0A                self.servers = self.detect_nodes(url)%0A%0A
         
@@ -903,37 +903,32 @@
 %5D):%0A            
-self.
 servers = %5B%22http
@@ -969,9 +969,492 @@
         
+    if detect_live_nodes:%0A                url = servers%5B0%5D%0A                self.servers = self.detect_nodes(url)%0A                %0A    def detect_nodes(self,url):%0A        url = url+'zookeeper?path=/live_nodes'%0A        live_nodes = urllib.urlopen(url).read()%0A        data = json.loads(live_nodes)%0A        children = %5Bd%5B'data'%5D%5B'title'%5D for d in data%5B'tree'%5D%5B0%5D%5B'children'%5D%5D%0A        nodes = %5Bc.replace('_solr','') for c in children%5D%0A        return %5B%22http://%25s/solr/%22 %25 a for a in nodes%5D
 %0A

add option to detect live nodes, if wanted