title: py2neo - Unable to fetch Data from a remote server
body: <p>I am using Py2neo package to query my database which is located in a server machine.</p>
  
  <p><strong>My code snippet:</strong></p>
  
  <pre><code>from py2neo import Graph,authenticate
  import time
  from py2neo.packages.httpstream import http
  http.socket_timeout = 9999
  
  
      def dbConnect():
          graph = Graph("http://192.xxx.xxx.xxx:7473/root/neo4j.graphdb")
          print(graph)
  
          #execute a cypher query
          cypher()
  
          return 
  
      def cypher():
          start_time = time.time()
          result = graph.cypher.execute("MATCH (n) RETURN COUNT(n)")
          print(time.time - start_time)
          return 
  
      if __name__ == '__main__':
          dbConnect()
  </code></pre>
  
  <p>Unable to fetch data from the machine, in turn returning with a error,</p>
  
  <p>Error Message:</p>
  
  <pre><code>&lt;Graph uri=u'http://192.168.204.146:7473/root/neo4j.graphdb/'&gt;
  Traceback (most recent call last):
    File "D:\Innominds\Collective[I]\Dev\Graph\Cypher_VS_Api.py", line 30, in &lt;module&gt;
      dbConnect()
    File "D:\Innominds\Collective[I]\Dev\Graph\Cypher_VS_Api.py", line 19, in dbConnect
      cypher()
    File "D:\Innominds\Collective[I]\Dev\Graph\Cypher_VS_Api.py", line 25, in cypher
      result = graph.cypher.execute("MATCH (n) RETURN COUNT(n)")
    File "C:\Python27\lib\site-packages\py2neo\core.py", line 661, in cypher
      metadata = self.resource.metadata
    File "C:\Python27\lib\site-packages\py2neo\core.py", line 213, in metadata
      self.get()
    File "C:\Python27\lib\site-packages\py2neo\core.py", line 258, in get
      response = self.__base.get(headers=headers, redirect_limit=redirect_limit, **kwargs)
    File "C:\Python27\lib\site-packages\py2neo\packages\httpstream\http.py", line 966, in get
      return self.__get_or_head("GET", if_modified_since, headers, redirect_limit, **kwargs)
    File "C:\Python27\lib\site-packages\py2neo\packages\httpstream\http.py", line 943, in __get_or_head
      return rq.submit(redirect_limit=redirect_limit, **kwargs)
    File "C:\Python27\lib\site-packages\py2neo\packages\httpstream\http.py", line 433, in submit
      http, rs = submit(self.method, uri, self.body, self.headers)
    File "C:\Python27\lib\site-packages\py2neo\packages\httpstream\http.py", line 325, in submit
      response = send("peer closed connection")
    File "C:\Python27\lib\site-packages\py2neo\packages\httpstream\http.py", line 318, in send
      return http.getresponse(**getresponse_args)
    File "C:\Python27\lib\httplib.py", line 1074, in getresponse
      response.begin()
    File "C:\Python27\lib\httplib.py", line 415, in begin
      version, status, reason = self._read_status()
    File "C:\Python27\lib\httplib.py", line 379, in _read_status
      raise BadStatusLine(line)
  httplib.BadStatusLine: ''
  </code></pre>
  
  <p>Observe, the first line in the error message just a print statement in the code, which is printing the graph object to the console. And, http import is a googled knowledge.</p>
  
  <p>What are the required setting and changes to be made in order to access the graph database in the server machine from my local machine.</p>