Error - WebSocket is already in CLOSING or CLOSED state


I made a new Graph in my Database. And the new graph has new credentials of bolt, http and https. I am able to start the browser from the second newly created Graph and create new nodes and relationships .


However, when i run it in Neovis.js code, i get error -

    WebSocket is already in CLOSING or CLOSED state.

    Error: "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"

code -

   <!doctype html>
   <meta charset="utf-8"/>
    <title>Neovis.js Simple Example</title>
    <style type="text/css">
    html, body {
        font: 16pt arial;
    #viz {
        width: 1200px;
        height: 650px;
        border: 10px solid #456789;
        font: 22pt arial;

        <!-- FIXME: load from dist -->
       <script type="text/javascript" src=""> 




      <script type="text/javascript">
      var viz;
      function draw() {
        var config = {
            container_id: "viz",
            server_url: "bolt://localhost:7687",
            server_user: "neo4j",
            server_password: "V1",
            labels: {
                //"Character": "name",
                "API": {
                    "caption": "name",
                    "size": "pagerank",
                    "community": "community"
                    //"sizeCypher": "MATCH (n) WHERE id(n) = {id} MATCH (n)-[r]-() RETURN sum(r.weight) AS c"
            relationships: {
                "cc": {
                    "thickness": "weight",
                    "caption": false
        RETURN cc",
           initial_cypher :"MATCH (n) RETURN (n)"  ,                 
           arrows: true
        viz = new NeoVis.default(config);