Integrate easyrtc server in tomcat - node.js

i have a webapplication which is realized with servlets running on a tomcat server. This web application should also include a realtime videochat, for which i have choosen easyrtc. I have setup the easyrtc server already (via nodejs) and have changed the default port to 9090, to make it different from tomcat. It works just fine when running standalone, but i have problems to integrate it within the tomcat web application (since the easyrtc files are searched under the tomcat's port, which is 8080). I have read the manual but i have not yet found a solution for my requirement. Can someone point me in the right direction, probably providing some best practive? An iframe would be no alternative, since i need to share some javascript variables among the different pages on my web app.
Thanks in advance,
fredddmadison

I have found the solution:
When initializing the easyrtc on the client side, the following call can be used to set the url for webrtc:
easyRTC.setSocketUrl(some_url);
and everything works as expected.

Related

deploying a node.js application on windows

I have developed a node.js application. I have two files serverpart.js and index.html (the html file is already referenced in server.js). During my development I run the application using command node serverpart.js and then access the client using http://localhost/8070. That was nice but now my application is ready and I want it to be accessed from other machines on the LAN. So please advice where should put these files(in some particular director). Do I need any web server for that please suggest.

websphere: requested url was not found on this server

I am developing my first web application with EJB, JSF and JPA. I use rational developer for developement and test, and our server is an iSeries with websphere 8. I do not have access to the test and production server, i can only manage the one I locally installed for developement purpose.
So now, my web application is working perfectly on my local installation, but I can't make it work on the production or test server. I produce the EAR with Rational Developer, our sysadmin publishes it on the server, the logs show no error (everything seems fine), but when I then try to reach the application via browser, i get the message
404 not found: requested url was not found on this server
In locale, i have the application installed under
http://localhost:9080/<contextroot>/pages/login.jsf
I tried several different urls but I always get that error message:
http://<production_server_url>/<contextroot>/pages/login.jsf
http://<production_server_url>:80/<contextroot>/pages/login.jsf
http://<production_server_url>:9080/<contextroot>/pages/login.jsf
http://<production_server_url>/<contextroot>/
I asked the sysadmin to send me the screenshots of the steps he goes through when installing the app on the server to see if there was some difference in the configuration, but everything is the same. The contextroot is correct.
We have other web applications that run on the servers, but those are simple .war files, this is the first EAR we try to deploy (i.e. as such, websphere incapuslates war files into ear projects in order to run them)
We have no idea what to do, can anyone help?
What bothers me the most is that the deploy itself goes well, the app is installed and running, I just cannot reach it
Thanks
Solution: The application server was running on a different, non-standard port. As suggested by #Jarid i found the correct port under
<profile_config>/cells/<cellname>/nodes/<nodename>/serverindex.xml
at endpoint WC_defaulthost. I can access the application at
http://<production_server_url>:>WC_defaulthost_port>/<contextroot>/pages/login.jsf

How can I mount easyrtc on webserver?

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

Ghost blog integrated with application

I am new to node, so please excuse me if I am asking stupid questions.
Ghost has been released as NPM module recently. I am trying to integrate it with my application, so I could have custom home page and serve blog on a separate page. Once I do following in my app.js, it takes over all the traffic to my site. How do I configure ghost to serve only the blog?
var ghost = require('ghost');
ghost();
We're missing a few details here so I'll make some assumptions.
If you are hosting node using the default server than (as of this posting) you are out of luck since ghost is setup to run in it's own standalone server. One possible solution is to run both the standard node.js server for your page then another for ghost. That's obviously not ideal but until they fix their integration issues you don't have much choice.
I'm trying to solve the same problem, and currently imagine finding a hosting that allows me to run two node instances (I think that is quite possible with e.g. digital ocean). One - port 80 - will point to Ghost, while the other (on some other port) will host the REST API for the app.
I will then create a blank page linked to a custom template that loads the rest of my angular application - the files will be stored in the assets folder of my custom template, while ajax calls will simply be to the non-standard port.

How to replace IIS with Node.js for simple websites

I am coming from Microsoft world so please bear with me on this. I was told I could install node.js and use that as a web server instead of IIS. This is a very small business application. In IIS I can create virtual directory and point to the location of the web page and everything works just fine. Based on very little I read, I have few questions;
Is it possible to run node js as a windows service or any other form so that it runs for ever? I did find the forever package that I think I can use.
In IIS, I can create virtual directory set the port and thats it, I have myself a website.
I do not see any examples where I can use a directory where I have a web page, written in java script and point it to run as a web site. All the examples have some thing like server.js and that runs and routes the call. what is the other way to host web sites and use node.js to simple run as a fast web server.
I was told I could install node.js and use that as a web server instead of IIS.
This is true, but as you already found out then you are in charge of providing for things that IIS was already doing for you (e.g. automatically restart on reboot, or on crashes, hosting multiple sites by creating virtual folders, et cetera.)
You can indeed get all of these things worked out in Node.js and there are several libraries that help on each of these areas. It's not too hard but you'll need to do a bit of researching.
You can also run Node.js behind IIS. Take a look at iisnode http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html
Is it possible to run node js as a windows service or any other form so
that it runs for ever?
The library Forever takes care of restarting the site when it crashes...but I don't know if you can run it as a Windows Service. I haven't tried that.
In IIS, I can create virtual directory set the port and thats it,
I have myself a website.
I assume you are talking about a site that serves static HTML files, right? If that's the case that's very easy to support in Node.js either writing your own web server or using Express.js to serve static files.
I do not see any examples where I can use a directory where I have a web page,
written in java script and point it to run as a web site. All the examples
have some thing like server.js and that runs and routes the call.
Here is an extremely simple example to serve plain HTML files in Node.js https://gist.github.com/2573391 Don't use this in production, though. It's just an example and it does not have any kind of error handling or security.
what is the other way to host web sites and use node.js to simple run
as a fast web server.
As others have said, you should look into Express.js http://expressjs.com/ It provides some of the infrastructure that you are very likely going to need when building traditional web sites.
You say you're running a "very small business application" behind IIS. Unless it's written for Node.js (in JavaScript), it won't work.
There are no examples pointing to a directory and running that as a website, because that's not how things are done in Node.js. You write a Node.js-application and pull in a webserver-library.
Put simply, In Node.js, you don't embed the appliation in the webserver; you embed the webserver in the application.
When I used node.js, I redirected HTTP requests by a proxy server, nginx. I don’t know if you can directly bind node.js as an HTTP server, but for what’s it worth, nginx is pretty nice!
First things first, allow me to share an introduction. IMHO you should take this decision ( of moving from IIS to nodeJS) by adding various parameters. I belong to the Java & PHP community yet I use NodeJS to achieve extremely specific implementation where NodeJS perform the fastest ( fast IO, AJAX-JSON responses & more ). As you are coming with a Microsoft background you should bare with less comfortable solutions.
Yes, its possible to run NodeJs as a windows service and Forever will do fine.
and yes you can create "Virtual Directories" but by creating symbolic links to each of your customer's web site.
I recommend to take a good look at bouncy & express, If you're willing to take this step then these packages is just what you need.
Cheers!

Resources