How to receive NodeBB server notification from external web socket client
-
I have installed NodeBB for exploring it's features and it is superb one. I am trying to receive notifications that are received and displayed on NodeBB page (local installation) in an external web socket client that I have developed. My NodeBB server is running at http://localhost:4567 and I tried to use the same URL in my websocket client app to connect and receive notifications from my NodeBB server. However, it didn't work.
I have developed a simple Node express server that runs on http://localhost:8080 and I can receive notifications from that server in my web socket client using the URL http://localhost:8080.
If someone can provide pointers / help on how can I connect my web socket client to my local NodeBB server and receive notifications that will be very helpful.Thanks in advance!
-
-
@learner What language are you using?
-
@julian Thanks for response and sorry for delay on my part as I was down!
I notice that while connecting to the websocket, browser requests with URL like below -
ws://<IP address>:4567/socket.io/1/websocket/GQlkcIbCyFu8a5C_tNyL
The last portion of the URL, i.e, “GQlkcIbCyFu8a5C_tNyL” changes to some different value in times and is not static throughout the browser session.
If I try to connect to the socket without this token, i.e, “ws://<IP address>:4567/socket.io/1/websocket”, I am not able to connect to it. It requires the last part as well. I am not sure how this token is generated or how to fetch this token before starting the socket connection.
If I try chrome websocket plugin to test connection, I always get handshake error “7:::1+0” if I do not use this token, otherwise able to connect to it with token copy pasted from browser dev eloper tools.
Thanks for your guidance in advance!
-
-
@julian said:
I'm unfamiliar with C#, and we don't handle socket establishing on our end, we just let the socket.io library handle it.
Perhaps you can get a better idea by investigating the source code of this project? http://socketio4net.codeplex.com/
Hi Julian,
I am using that only. Can you provide some help on how can I connect using Chrome Web socket plugin, I mean what URL to use? That might clarify my query.My objective of using C# is that I want to see whether I can get notifications from outside without logging into my local NodeBB application.
Thanks!
-