our team use both web server(tomcat or jboss) and node js
my team member make user management in web server. and
and he will send user session to node js socket.
is it possible? for node js how to receive web socket connection from web server?
I use express, socket io,webrtc.io module in nodejs
Yes web servers can communicate to the node js using curl, which hits url and process the response.
Related
I having some doubts that:-
what is need to use the socket.io client we can use only the socket.io server to stop refreshing the app.
what is different between the socket.io client and socket.io server.
check this link
socket-io.client is the code for the client-side implementation of socket.io. That code may be used either by a browser client or by a server process that is initiating a socket.io connection to some other server (thus playing the client-side role in a socket.io connection).
A server that is not initiating socket.io connections to other servers would not use this code. This has been made a little more confusing that it probably should be because when using socket.io, it appears that both client and server are using the same socket.io.js file (because they both refer to a file with the same name), but is not actually the case. The server is using a different file than the client.
From the Github page for socket-io.client:
A standalone build of socket.io-client is exposed automatically by the socket.io server as /socket.io/socket.io.js. Alternatively you can serve the file socket.io.js found at the root of this repository.
Keep in mind that there are unique features that belong to client and server so it should not be a surprise that they use some different code. Though they share code for parsing the protocol and things like that, the server has the ability to run a server or hook into an existing web server and it has methods like .join() and .leave() and data structures that keep track of all the connected sockets and is expected to live in the node.js environment. The client has the ability to initiate a connection (send the right http request), do polling if webSockets are not supported, build on a native webSocket implementation if present, etc....
I have created a socket server in Node js. It is working fine while subscribing from an ejs file.
The part I'm confused is how do I keep my laravel application listening to the server I have created?
Thanks in advance.
Laravel community already come up with a solution and it's call Laravel Echo Server (Check that out) that basically just a Node + socket.io that implement all the pub/sub logic for your Laravel app.
If you want to take complexity into your own hand then you could try setting up broadcasting driver in Laravel to use Redis. In simple term, Redis is the middleman that connect your Laravel app to your socket.io app for websocket connection. This is call message broker.
For example, you have Laravel app listening and publishing event on a Redis server and Node + Socket.io server doing the same thing. When you fire an event through Laravel, your node will able to listen to that event too through Redis acting as a broker. Your node then can instruct Socket.io to do whatever it want with its front-end user.
This solution doesn't require Laravel-echo but you need to do a lot of stuff for authentication, handling private channel and presence channel .. etc.
I suggest you take a look into Laravel Echo Server as what I've describe is only scratching the surface.
I have created a chat application using node.js, socket.io and mongodb and hosted it on a server.
Now I want to use that chat application on different website by taking a link or code and embed it in normal website that is hosted in another server that uses apache.
I have used an application for login, adding friends and chat using node.js and mongoDB.I installed the node.js and monogoDB on ec2 instance. However, I do not know if need to use client server and http server?
Here is the application that I used https://github.com/1karthik/Node.js_UserLogin_Template
note: I am new to node.js and mongoDB
you dont need a "client server". Your http server will serve to your clients some javascript files that will help them to comunicate with your server. If you go in app/public/scripts you can see theese files.
I have an existing Tomcat application which has an existing authentication and session management and I am currently building a NodeJS server to handle real time communication with users via web sockets (using Socket.IO).
My question is what is the best method of keeping a session for the websockets given that the user will never visit the NodeJs server and no cookies are set upon connecting via the web socket and there is currently no persistence when the socket is closed (i.e when a user moves between pages).
I have seen methods of doing this when using Express and Socket on the same site but never when using Socket.io only for web sockets. Is this possible?