I am using Neo4j database as graphenedb on Heroku connecting using Ember.js framework. The application is being run locally through Node.js (Not being run through Heroku server).
On a call to driver.session(); I receive this error:
WebSocket connection to 'ws://hobby-blablabla.dbs.graphenedb.com:24786/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
I import driver using ember-browserify:
import Neo4j from 'npm:neo4j-driver';
I call the code:
var neo4j = Neo4j.v1;
var driver = neo4j.driver(graphenedbURL, neo4j.auth.basic(graphenedbUser, graphenedbPass));
var session = driver.session(); // error it thrown here
I retrieved the connection infos using Terminal commands with Heroku CLI like: heroku config:get GRAPHENEDB_BOLT_URL
Chances are that Heroku doesn't actually allow me to connect to the database from my local machine. But it would be really nice to work around this issue and be able to connect. Thank you for help.
I'm Judit from GrapheneDB. If I understood you well, you're loading the Neo4j javascript driver in your Ember.js application and the driver is trying to connect to GrapheneDB database via WebSocket. Unfortunately this is something we don't support.
We always recommend to add to your stack a backend, that deals with the connection to GrapheneDB, and avoid doing it from the browser and prevent exposing your credentials to anybody using your app. You can build a Node.js server and manage the driver connections there using the same driver you are using now (npm install neo4j-driver
).
BTW, you should be able to connect to your database from your local machine using the values of your Heroku environment variables. You can easily check by running:
GDB_URL=`heroku config:get GRAPHENEDB_URL`
curl -v $GDB_URL