Search code examples
javascriptneo4jmemgraphdb

How to connect using Neo4j driver over IPv6?


Is it possible to connect to a Neo4j or Memgraph database over IPv6? I am using the neo4j-driver javascript library but it seems that it is not able to parse a IPv6 connection string:

const driver = neo4j.driver("bolt://fdaa:0:a23f:a7b:c988:dd94:aff3:2:7687"); // Error: getaddrinfo ENOTFOUND fdaa

Solution

  • Try wrapping the IPv6 address in brackets like so

    const driver = neo4j.driver("bolt://[fdaa:0:a23f:a7b:c988:dd94:aff3:2]:7687");
    

    I'm not sure this will work with the JS driver, but this is how you would do it with the Neo4j Python driver.