erbbysam / webRTCCopy

A simple file sharing application using webRTC-data.io
251 stars 45 forks source link

not able to run on local machine #1

Closed tusharkadam closed 10 years ago

tusharkadam commented 11 years ago
       Please provide latest server.js code in WebRTC copy (for text chat application and file sharing).  existing server.js file is same as WebRTC demo(for video confernce and chat).

       If existing server .js file is right one then what all changes,I need to do to work.

Regards, Tushar k.

erbbysam commented 11 years ago

I'll update this project to make it easier. The install process here is missing all dependencies.

I would recommend following the installation directions on webrtc.io-demo and replace the webrtc.io "webrtc.io.js" & "server.js" files (with the webrtc-data.io "webrtc.io.js" & "server.js" files included in the /server/ folder here).

I should have this fixed at some point in the next few days. Thanks, Sam

tusharkadam commented 11 years ago

Everything works fine. when I, connect to your server that is "rtc.connect("ws:rtccopy.com:8000", room, username);" in script.js file. but when I am replacing same line with "rtc.connect("ws:192.168.11.43:2222", room, username);" which server.js file is running on my local server on 2222 port at that time, I am getting error as "undefine has join the room " in javascript console log. Therefor I think,I am missing something in my server.js file

  My modified server.js file is bellow(also I have copied all files from Client folder to server folder and as per file path I have changed some code. Is I need to add some extra code here for connection?):

var app = require('express')(); var server = require('http').createServer(app); var webRTC = require('webrtc.io').listen(server);

var port = process.env.PORT || 2222; server.listen(port);

app.get('/', function(req, res) { res.sendfile(__dirname + '/index.html'); });

app.get('/style.css', function(req, res) { res.sendfile(dirname + '/style.css'); }); app.get('/colorbox.css', function(req, res) { res.sendfile(dirname + '/colorbox.css'); });

app.get('/ext-js/jquery.js', function(req, res) { res.sendfile(dirname + '/ext-js/jquery.js'); }); app.get('/ext-js/jquery.colorbox-min.js', function(req, res) { res.sendfile(dirname + '/ext-js/jquery.colorbox-min.js'); });

app.get('/ext-js/base64-arraybuffer.js', function(req, res) { res.sendfile(__dirname + '/ext-js/base64-arraybuffer.js'); });

app.get('/js/script.js', function(req, res) { res.sendfile(__dirname + '/js/script.js'); });

app.get('/js/file-io.js', function(req, res) { res.sendfile(__dirname + '/js/file-io.js'); });

app.get('/js/webrtc-data.io.js', function(req, res) { res.sendfile(__dirname + '/js/webrtc-data.io.js'); });

app.get('/images/overlay.png', function(req, res) { res.sendfile(__dirname + '/images/overlay.png'); }); app.get('/images/loading_background.png', function(req, res) { res.sendfile(__dirname + '/images/loading_background.png'); });

app.get('/images/loading.gif', function(req, res) { res.sendfile(__dirname + '/images/loading.gif'); });

app.get('/images/controls.png', function(req, res) { res.sendfile(__dirname + '/images/controls.png'); });

app.get('/images/border.png', function(req, res) { res.sendfile(dirname + '/images/border.png'); }); app.get('/webrtc.io.js', function(req, res) { res.sendfile(dirname + '/webrtc.io.js'); }); webRTC.rtc.on('connect', function(rtc) { //Client connected });

webRTC.rtc.on('send answer', function(rtc) { //answer sent });

webRTC.rtc.on('disconnect', function(rtc) { //Client disconnect });

    May I get server.js file running on "rtccopy.com:8000"?

Regards, Tushar K.

jangidravi commented 11 years ago

I am also getting same error when running on my own node.js. In console it shows error when another user connects in same room I am getting rtc.usernames UNDEFINED. image

Regards, Ravi Jangid

erbbysam commented 10 years ago

https://github.com/erbbysam/webRTCCopy/commit/7f0862e2ed77e2f27f685d567fe26e4fabb6da3f

Alright, I have updated the directions about how to install this and made the server more obviously separated into two parts. 1) The client part can be hosted via node.js, however, I choose to host this via apache (like a simple site via /var/www/). 2) I use node.js solely as the signaling server and where I hold basic information about the rooms. I have updated the server folder to make sure that it installs properly.

Both of these folders are now exact copies of what is hosted (besides the missing Google Analytics code). If you still have any trouble let me know. Thanks, Sam