neo4j-contrib / neovis.js

Neo4j + vis.js = neovis.js. Graph visualizations in the browser with data from Neo4j.
Apache License 2.0
1.59k stars 324 forks source link

Need to send a wss instead of ws in my project #340

Closed Mingaaaaaaa closed 1 year ago

Mingaaaaaaa commented 1 year ago

I deploy my web on https (mini program required) but I find out that the graph can't render cause it send a wss request to my server. image

thebestnom commented 1 year ago

Neovis does support wss, you'll need to use bolt+s though instead of bolt

Mingaaaaaaa commented 1 year ago

But when I tried bolt+s or neo4j+s it became another error.
And I find a similar issue on https://github.com/grand-stack/grand-stack-starter/issues/129. still don't know how to solve this .

截屏2023-04-23 21 44 13
thebestnom commented 1 year ago

https://github.com/neo4j-contrib/neovis.js/issues/291

thebestnom commented 1 year ago

Can I close?

Mingaaaaaaa commented 1 year ago

maybe not, I try the config but still send a ws request image

thebestnom commented 1 year ago

Can you send a censored config as text here?

thebestnom commented 1 year ago

Ohh you're using the config incorrectly, not server_url, serverUrl unless you are using 1.x for some reason

thebestnom commented 1 year ago

Same with user and password

Mingaaaaaaa commented 1 year ago

sry I did use the 1.4.0 cause I fork an old repo config below

  const config = {
            container_id: 'id1',
            server_url: "neo4j://xxxxx",
            server_user: "xxxx",
            server_password: "xxxxx",
            driverConfig: { 
                 encrypted: "ENCRYPTION_ON",
                trust: "TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"
                },
            labels: {
                Troll: {
                    caption: "user_key",
                    size: "pagerank",
                    community: "community",
                },
            },
            relationships: {
                RETWEETS: {
                    caption: false,
                    thickness: "count",
                },
            },
            initial_cypher: "MATCH (n) RETURN n LIMIT 25"
        };
thebestnom commented 1 year ago

If you're using old 1.x you need to put encrypted and trust flat on the config instead of inside driverConfig

  const config = {
            container_id: 'id1',
            server_url: "neo4j://xxxxx",
            server_user: "xxxx",
            server_password: "xxxxx",

            encrypted: "ENCRYPTION_ON",
            trust: "TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"

            labels: {
                Troll: {
                    caption: "user_key",
                    size: "pagerank",
                    community: "community",
                },
            },
            relationships: {
                RETWEETS: {
                    caption: false,
                    thickness: "count",
                },
            },
            initial_cypher: "MATCH (n) RETURN n LIMIT 25"
        };

though I do suggest using 2.x as it is much more flexible and can do pretty much everything vis network can do

Mingaaaaaaa commented 1 year ago

wss work!
but

  Neo4jError: Could not perform discovery. No routing servers available. Known routing table: RoutingTable[database=default database, expirationTime=0, currentTime=1682267644588, routers=[], readers=[], writers=[]]

is this mean my server need to config something?

thebestnom commented 1 year ago

I actually never saw this bug 😅

thebestnom commented 1 year ago

https://github.com/neo4j/neo4j-javascript-driver/issues/516 Probably this?

thebestnom commented 1 year ago

Anyway, closing as complete, good luck! 😄