Running Easyrtc in www

497 views
Skip to first unread message

Frédéric NERET

unread,
Dec 18, 2012, 5:02:15 PM12/18/12
to eas...@googlegroups.com
Hello,

First, congratulation for this product that will save us a lot of time!

I install it on an Ubuntu server, and it is running perfectly, but I can use html samples only in the static folder.

How can I configure the server to use html samples from the www folder?

The probleme begins here:
<script src="/socket.io/socket.io.js"></script>

Thank you for your help,

Fred.

Rod Apeldoorn

unread,
Dec 18, 2012, 6:23:11 PM12/18/12
to
Howdy Fred,

Just this minute I'm working on making it easier to split up the demo's so you can define your own project root. We hope to have it out by the end of the week. (along with a few other improvements).

In the meantime, in server.js, is a line which reads (line 37ish):

httpApp.use(express.static(__dirname + '/static/'));
 
You can change the argument to be a string pointing to your own web root, such as:

httpApp.use(express.static('/var/www/'));

This method will still require you to use easyRTC as your web server.

In the next version we'll also be making it easier to allow easyRTC to work alongside an existing web server (ie Apache), essentially relegating the easyRTC server to strictly manage sockets.

Rod Apeldoorn, Priologic Software Inc.

Frédéric NERET

unread,
Dec 19, 2012, 6:12:17 PM12/19/12
to eas...@googlegroups.com
Hi Rod,

Thank you for your quick reply, we made the changes, but we have still an issue:
We use the audio_video demo.
If we use : http://xxx.xxx.xxx.xxx/audio_video.html  (in the www folder)
Error at line 31 <script src="/socket.io/socket.io.js"></script>
Of course, the path is wrong because we are in www
So we try :
It's ok but now we get:
GET http://xxx.xxx.xxx.xxx/socket.io/1/?t=1355957075316     404 (Not Found)   socket.io.js:1659

But when we use http://xxx.xxx.xxx.xxx:8080/audio_video.html, it's running well

Also I would like to know if we must use an url with the port number, or is it possible to run without this information?

We also made tests through different internet access boxes, sometimes it's ok, sometimes not, we don't know why.

I think we will have to wait the next release (at the end of the week?) to go further.

Thank you,

Fred
PS : We are more competent on the client side than on the server side... :)

Rod Apeldoorn

unread,
Dec 19, 2012, 7:25:28 PM12/19/12
to
Hey Fred,

It sounds like you have port 80 being handled by Apache (or another web server). For our first version we kept things simple and didn't handle the likelyhood of using an external webserver.

We knew it would be a requirement for many, so I did add it to our upcoming features page as 'External server support'. The hope is to make it changeable using configuration options, but it isn't there yet..

To do it manually:

Edit easyrtc.js (the client side API file). Look for the following around line 825:

channel = io.connect();

Change the parameter to a URI pointing to the easyRTC install. If you have it on the same server as your web server, you can use the shorthand of ':8080'.

channel = io.connect(':8080');

Frédéric NERET

unread,
Jan 2, 2013, 1:28:13 PM1/2/13
to eas...@googlegroups.com
Hey Rod,

We are back again and wish you an happy new year!
2013 will be hte WebRtc year, isn't it?

So we install the new version with success, and try your tip in the easyrtc.js file:
channel = io.connect(':8080');

Unfortunatly, we always have tu use the url with port number eg http://xxx.xxx.xxx.xxx:8080/

Any idea?

Thanks,

Fred

Eric Davies

unread,
Jan 2, 2013, 4:00:08 PM1/2/13
to eas...@googlegroups.com
Hi Fred,

Rod and I are back at easyRTC again as well! 

I've stepped through the io.connect code. It has specific logic to parse the argument to io.connect into component parts, and replace missing parts with values from the browser's location variable (which should reflect your html page). I've done a few experiments over here to verify this works.  Just to be complete, I should ask if your web page is being served via http or https (since io_connect would try to inherit the protocol as well).

My suggestion would be to put a break point at line 93 of io.connect.js. This logic at this line looks like:
if (options['force new connection'] || !io.sockets[uuri]) {
socket = new io.Socket(options);
}
Then manually examine the contents of the "options" variable when you are using ":8080" and "http://xxxx.xxx.xxx.xxx:8080".
There should be some difference in the "options" variable's contents between different URLs that will account for why one URL works and the other doesn't.

Eric.

Reply all
Reply to author
Forward
0 new messages