How can I mount easyrtc on webserver? - node.js

I'm trying to develop a video chat web-application with webrtc using easyrtc. I have developed it on my local machine. It runs well with node.js server on my localhost. But how can I mount it on my web-server? That means, when a user visit my website, he will able to video chat by this.

Very simple..put your project on sever, open firewall that allows connection throws in and out. Then integrate with your authentication system..
Done

If you have developed the application on node.js, you only have to follow the deploying procedure for an node.js app. In case that you have an app (php, ruby, python or others) that uses easyrtc as an signaling server, you can deploy your easyrtc and app to the same server or separately.
On the secon case you should use easyrtc.setSocketUrl("//mydomain.com:8080"); to avoid connection issues related to socket.io. For more info on this see:
https://easyrtc.com/docs/easyrtc_with_other_servers.php
Also remember that you application needs to work with https to work correctly in Chrome. See this:
https://developers.google.com/web/updates/2015/10/chrome-47-webrtc

Related

Electron like node integration in nodejs web server

I'm new to web servers in nodejs and i'd like to know if there is possible to have an electron like node integration in a web server (to be able to use nodejs in index.js script file linked to index.html)
Thx for all :)
It's not possible. Browsers control the way that client side JavaScript is executed, so it's just technically impossible to connect both runtimes in any way that works on client machine, you'd need a customized browser, which is what Electron basically is. And neither should you want to - if the runtimes were connected in that way, any user could execute arbitrary commands on your server.

how to deploy an ionic-react app to mobile if I'm using node js server in the backend?

I discovered ionic this week and I'm really considering using it at work.
Basically, my goal is to build an app that will work on android and Ios, where the needed functionality is to connect to the cloud over web socket and pull data from the cloud and show it on my phone. Maybe later I'll eventually need to consider using login but not for now at least.
Normally, if I'm building a web app. I ll use nodejs to pull the data from the cloud and expose it to the frontend. I ll write all code together and I ll host my app in Heroku or something where the entry point is my nodejs server right? So that my server needs to start and it will take care of the rest.
This is a bit confusing in ionic since I need to start the app with ionic serve, but somehow I also need to start my nodejs server too right? So I assume I can't write the server-side code inside the ionic app or am I wrong?
There is not much about this on the internet but I did some research and I guess that I should deploy (host) my nodejs server in the cloud (maybe using Heroku) and then connect to the server from my mobile app over the socket. Is this the right/only way to do this? are there any security issues with this method?
I find ionic great but I'm not sure if I should use it at work. Sincerely, this use case of using a backend server with ionic made me confused.
Ionic looks ideal for building cross-platform apps that does not need server-side scripting, but how complex can it be if I want to integrate some server-side code in my app? especially as I said I'm going to use some login forms in the future to extend the functionality of my app.
PS: I'm using ionic 6.10.1 and specifically I'm interested in using ionic with react not with angular.
After some search, I discovered that it isn't possible to deploy the frontend and backend code together. Therefore the trick is to deploy the nodejs server separate from the frontend.
Precisely, if it is a web app, then you should deploy the nodejs server in a separate host from the frontend. Then by starting the frontend app, you can communicate with the running nodejs server via socket or REST API.
Hope this helps someone in the future :)

Chatbot using Api.ai nodejs angular socket.io

I have been using api.ai javascript SDK on angular to build my chat app to integrate it with the website. As this javascript sfk is deprecated I am now exploring to build the same on Node JS SDK with socket.io for real-time experience and angular for client features...
Currently, I'm following the below link to build my chat app
https://codingblast.com/chat-application-angular-socket-io/
As I am very new to Node I have lots of doubt like...
How to deploy my node and angular app on a server to host it on my website
Angular and node can it be deployed as a simple app.. if so what are the steps and how could I achieve it.
Is node is possible ti have multi threading as many users might chat with my chatbot in parallel before on angular it will be acheived by session id.. but how it is possible on the node?
Is it fine to deploy my node app on my existing apache server or should I use separate server
How can I host multiple node js chat app on a single server since each app will use a port... how much it is possible...
Which server is recommended for node deployment windows ubuntu or Linux.
Please help me...
Angular Apps are static files that can be served using any server. For NodeJS, you will need a server that supports NodeJS runtime execution environment. A simple cloud server will do. (AWS or others that you may prefer)
Angular runs on the client-side, NodeJS runs on the server-side, there is no "Simple App Deployment" (as far as I've known). You need to run the NodeJS server code which will server the REST API, and send the Angular deployment files to the client with some file server. (Even the NodeJS server can do it)
"Node.js is a single threaded language which in background uses multiple threads to execute asynchronous code" [Source]
But you can use "fork" to run parallel tasks. For chatbot, you may consider using WebSockets.
It is possible to run NodeJS with Apache server, but how you want to deploy it depends on your decision and architecture. See HERE for more information.
Link in no. 4 should have answer this this.
NodeJS can be deployed on both Windows and Linux(Ubuntu) environment. It depends on how much you can spend, and how much benefit that expenditure will bring you. (Linux server operating systems are totally free, Windows servers aren't)

Integrate Node with Phonegap app

I want to develop an hybrid cross platform app that creates a socket connection to given Ip.
I have achieved it using webTCP module in node.js by running node from cmd to start the server.
Now I want to pack this in to an app using Phonegap. But my question is how do I run node(to start server) in mobile through the app created using phonegap.
Do we need to install node in mobile. If so how can I do that?
Thanx in advance.
nodejs isn't done (yet) to run on Android. NodeJs is a server thing so it should run on your server to run tour backend.
In order to do what you want to do you will have to redesign your architecture.
Indeed, Cordova/PhoneGap is a little server (actually it's is a WebView but you can approximate it to a static content delevery server). So you will have to made your cordova app talk to your node-server.
1. CORS
Cordova-app <- INTERNET -> Node-server
The first thing to do is to enable CORS, for nodejs and whitelist the adress of your node-server in cordova
2. let's talk
Now you can start talking to your server with your cordova app, there is many ways to do that :
xhr/Ajax request
Pur WebSocket (you will need to enable JAVA-WebSocket)
Socketio
3. being more powerful
You will need more powerful feature between your app and your server side. In order to do that, you could need some WebApp framework. Indeed, they automate for you the connection between the server and your application and offer you a cool and easy environment to do great apps. If you want to know more about it, you could look at
BackBone
Marionette
AngularJs
Hope that help.

Deploy node.js on local server

I am currently running a website written with Flask on a LAMP server. I used mod_wsgi to connect the Flask app with Apache, and all is running well. However, I recently discovered websockets and would like to use them in my website. There is a Flask extension for websockets, but I was told Apache does not support websockets and that I could not use it.
I was introduced to Socket.IO running on nodejs at school, and I would like to try it out for my website (rewrite my website using nodejs). My question is how do I run the nodejs app from my local server as I did with my Flask app? I have searched Google, and people are recommending using Apache or Nginx, but will they support websockets? Thank you.
By launching your nodeJS server... Take a look at : A simple TCP based chat server written in node.js
(I'm not the author and I don't know him)
Then just: node myFile.js

Resources