neo4j / neo4j-javascript-driver

Neo4j Bolt driver for JavaScript
https://neo4j.com/docs/javascript-manual/current/
Apache License 2.0
859 stars 147 forks source link

How to disable wss request,just use ws #1147

Closed lionhear71994 closed 1 year ago

lionhear71994 commented 1 year ago

const URI = 'neo4j://xxx:7687'; const USER = 'neo4j'; const PASSWORD = 'xxx'; let driver; try { driver = neo4j.driver(URI, neo4j.auth.basic(USER, PASSWORD)); const serverInfo = await driver.getServerInfo(); console.log('Connection established');

when I use code above, always send a wss connection to the xxx:7687, how to change it to ws . Thank you all

bigmontz commented 1 year ago

Hey @lionhear71994,

if your using https in the browser, the driver by default will change to use wss since browser security usually not enables insecure connections happens when you are using secure protocol.

However, you can force disable by:

const driver = neo4j.driver(uri, authtoken, { encrypted: false  , //other configs });