1
votes

When I try to run the simplest html page that will show me graph of neo4j data, using neovis.js:

<html>
    <head>
        <title>DataViz</title>
        <style type="text/css">
            #viz {
                width: 900px;
                height: 700px;
            }
        </style>
        <script src="https://cdn.neo4jlabs.com/neovis.js/v1.0.0/neovis.js"></script>
    </head>   
    <script>
        function draw() {
            let config = {
                container_id: "viz",
                server_url: "bolt://54.210.87.221:32953",
                server_user: "neo4j",
                server_password: "cents-propeller-slits",
                labels: {
                    "Application": {
                        caption: "name",
                        size: "pagerank",
                        community: "community"
                    }
                },
                relationships: {
                    "DEPENDS_ON":{
                        caption: false,
                        thickness: "weight"
                    }
                },
                initial_cypher: "MATCH p=(Application)-[r:DEPENDS_ON]->() RETURN p LIMIT 25"
            };
            let viz = new NeoVis.default(config);
            viz.render();
        }
    </script>
    <body onload="draw()">
        <div id="viz"></div>
    </body>
</html>

I get this error message at the console:

"WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket readyState is: 3"

I saw the answer in https://neo4j.com/developer/kb/explanation-of-error-websocket-connection-failure/ But I didn't understood where I suppose to do the change, specially when I do not have any Neo4j files or configurations on my computer (Windows).

Why can't I connect to the bolt server like I saw in the guides?

1

1 Answers

0
votes

Like the link said, you need to tell Neo4j to listen on the network.

For this you need to change the Neo4j configuration by enabeling the line dbms.connector.bolt.address=0.0.0.0:7687 in the $NEO4J_HOME/conf/neo4j.conf.

So in your case you need to do that on your server 54.210.87.221, not on your local laptop.

Cheers.