neo4j / neo4j-javascript-driver

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

How to disable wss request,just use ws #1147

Closed lionhear71994 closed 11 months ago

lionhear71994 commented 11 months 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 11 months 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 });