I am currently learning node.js and I've just finished the chat using socket.io and express.js which works well. But now I'd like to expand this chat so that two users from differents computers could communicate.
I think it might be easier, first, using two computers on the same network but then I'd like the app to enable communication between two computers (each on a different network).
Is it possible using socket.io ? If yes, how ?
I guess there's something to change here :
server.listen(8080, function(){
console.log('listening on *:8080');
});
If someone knows how, please let me know !
Thanks
You'll need to host your nodeJS application to a web server, giving everyone access to your website.
To achieve that you will need to use Cloud Application Platform, like AmazonWebService, or Heroku. You will be able to host your nodeJS application to a server same as you do to develop but it will be online.
You could follow theses tutorials :
https://devcenter.heroku.com/articles/node-websockets
https://hackernoon.com/deploying-a-node-app-on-amazon-ec2-d2fb9a6757eb
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04
You can found more with this google search :
"deploy node js app nginx"
Good luck.
Related
I am new to programming field and I am basically trying to built a system based on web and app which is web based where two users can communicate and buy products from each other on my platform. The question I want to know is there any sytem if i can just code server side logic and connect front end of both web and app to the same logic which is saved on the server.....I hope am able to clearify my question...sorry for the bad english
I was looking for different solution but can't find a reliable one
yes, you can connect your website and flutter app, by using http pub
and get the data from api.
or you can build your website with flutter and in the same as app.
I hope that is answer your question, if not please explain more about what you mean
I have a project where I have users on the backend and I have go-karts run by rosbag which in turn is on the frontend. I want to put my topics in a database but I have no idea what it could be, that's when I found the rosnodejs option. Can anyone help me with how ROS works with nodejs? I can't find one on the internet that is connected to port 9090, which works by default.
I've followed the tutorial over building video chat with usage of PeerJs and Angular 4 (http://tphangout.com/angular-2-videochat-using-peerjs/)
Tutorial descibes it for ANg2 , but i was able to launch it with Ang 4
I plan to have a user, which sees the list of other others and can connect to any of them.
Decided to check if someone done this and might advise on following:
1) What is the best way to list users connected to Peer Server? Can this be done with some query ?
2) How to refresh the list if other users are available or disconnected?
So far, easiest way for me would be to store id of connected users in DB and query upon user visiting specific route.
ANy suggestions?
PeerJS is quite outdated, lib wasnt renewed for quite long. Ive researched and there are other options like simplewebrtc (works in chrome, ios etc) , easyrtc and others. The problem is that for those libraries there are no demo projects with Angular 2/4.
Thanks and Regards
You should save the peerjs id's to a database table, and then each client can show a list of them.
Have a look at https://github.com/mikkelking/meteor-video-call
Which is written in Meteor and Angular1.5 - it's really easy to run up, just follow the instructions (install Meteor first). It uses Meteor's reactive database to do live updates of the web pages. It uses the public peerjs server, and will only work on localhost - use Firefox for one end and Chrome for the other end of the video call.
You can ask more me questions if you want.
I'm in the process of creating a web app and native mobile apps. I've done a good amount of research and the best approach so far is to set up a separate API to handle a shared database between the web app and the mobile apps. Essentially, the database will be seperate from the web app.
For the web app, our stack is going to be React/Rails. I was wondering if someone could clarify ( what is probably really obvious ) how the rails controllers are going to communicate with the separate API ?
How will we render the components from the API database?
I'm probably over complicating things, but I could use some help.
I have developed a web application using node and backbone js which is in beta now. Now my client wants group chat to be integrated in that application. This chat should take place between users that are signed in to application. Is there any chatting tool that can help me to achieve this? Or I need to implement this by myself? I have never integrated chat in any web application before. I tried to google about customer-to-customer chatting tools but did not get any tool that can help me achieve this.
Since you are using node you can check socket.io for implementing real-time communication between users of your application. With node and socket.io out-of-the-box functionality exists for separating users into rooms for group chatting (and broadcasting)