prabushitha / gremlin-visualizer

visualize the graph network corresponding to a gremlin query
MIT License
227 stars 70 forks source link

Connecting to Neptune over Secure Websocket wss:// #21

Open jinman opened 2 years ago

jinman commented 2 years ago

This is a great visualizer. We are trying to connect to Neptune over secure websocket. we changed the proxy-server.js to connect to wss:// instead of ws://. However, its still unable to connect and does not give any errors as well. Has anyone been able to connect this library to Neptune securely over SSH tunnel recently (after they mandated HTTPS/SSL/WSS)? Please help.

Givemeurcookies commented 2 years ago

Works for me. Remember that Neptune requires servers to be connected via VPC. The proxy server has to be i.e on an EC2 with the same VPC as your Neptune database.

yaaraze commented 2 years ago

@jinman We found a workaround, in line 59 in proxy-server.js we also do:

const client = new gremlin.driver.Client(`wss://${gremlinHost}:${gremlinPort}/gremlin`, { traversalSource: 'g', mimeType: 'application/json', rejectUnauthorized: false });
jinman commented 2 years ago

@yaaraze were you able to connect without the SSH tunnelling?

We are only able to connect to via SSH tunnel

SSH tunnel

ssh -i .pem ec2-user@ -L8182::8182 Set chrome://flags/#allow-insecure-localhost

tomdistler-automox commented 2 years ago

@prabushitha I don't have permission to open a PR, so here's the change I'd suggest to support multiple protocols (a secure connection is required by AWS Neptune)

proxy-server.js:59

const client = new gremlin.driver.Client(`${process.env.GREMLIN_PROTO || 'ws'}://${gremlinHost}:${gremlinPort}/gremlin`, { traversalSource: 'g', mimeType: 'application/json' });

Then update README.md to also show: GREMLIN_PROTO=wss npm start