首页 > 解决方案 > 部署到 Firebase 后访问 Neo4J 端点时出现不安全的 WebSocket 连接

问题描述

我使用 Neo4j 创建了一个应用程序,但我尝试在 Firebase 中托管该应用程序,但出现以下错误

was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://ec2-18-140-45-111.ap-southeast-1.compute.amazonaws.com:7687/'. This request has been blocked; this endpoint must be available over WSS.

下面是我的代码

  draw() {
    const config = {
      container_id: "viz",
      server_url: "bolt://ec2-18-140-45-111.ap-southeast-1.compute.amazonaws.com:7687",
      server_user: "neo4j",
      server_password: "Password",
      labels: {
      },
      relationships: {
      },
      initial_cypher: "QUery",
      arrows: true
    }
    this.viz = new NeoVis.default(config);
    this.viz.render();
  }

我该如何解决这个问题?

请帮忙。

标签: angulartypescriptfirebaseneo4jwss

解决方案


您要么必须通过 encryption:false 要么必须为 Neo4j 服务器提供证书。

见:https ://neo4j.com/developer/javascript/#driver-configuration


推荐阅读