Direct browser to Memgraph connection

Hey there,

I’m looking for a way to connect my application to talk directly to Memgraph from a browser client. I can’t seem to find anything about this in your documentation.

Thanks in advance for the help :smiley:

1 Like

Hey @alice24,

That can be done by installing https://github.com/novnc/websockify

Websockify is available in four different languages: Python, C, Node.js, and Ruby. We have used Node.js (https://github.com/novnc/websockify-js) and it was working fine.

  • In order to establish a connection:
    1. Make sure Memgraph is running (let’s say it is listening on default port 7687)
    2. Run websockify where the target IP and port will be Memgraph. [NOTE] You can custom define a listening port for weksockify, e.g.: ./websockify.js 9999 :7687 (it will be listening for ws:// on port 9999)
    3. In the browser, you can get a connection by connecting to WebSockifyIP:9999

I hope this helps! Please let me know if I can help clarify anything.

Cheers,
Karim

Hey @Karim.T, thanks for the quick reply!

I used the Node.js Websockify and it worked. Thanks for the help :smiley: