webRTC-io / webRTC.io

An abstraction layer for webRTC. Aim is to simplify the HTML5 web standard webRTC in a similar manner to socket.io w/ websockets. Highly experimental technology
1.6k stars 293 forks source link

webrtc.io and express #46

Open calmchess opened 9 years ago

calmchess commented 9 years ago

Could somebody make webrtc.io compatible with express so i can use sockets from a server script and continue to use express. I've tried alot of things to make it work without success.

OmarIthawi commented 9 years ago

​This sounds like an XY problem http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem.

Please consider the following workarounds:

1) Put the webrtc.io and your expressjs server on different domains/subdomains e.g. webrtc.example.com and example.com respectively 2) Us​e another port and process for each instances,

You say that you have tried a lot, but you didn't say what have you tried!

On Sun, Jul 13, 2014 at 7:30 PM, Brian Berry notifications@github.com wrote:

Could somebody make webrtc.io compatible with express so i can use sockets from a server script and continue to use express. I've tried alot of things to make it work without success.

— Reply to this email directly or view it on GitHub https://github.com/webRTC/webRTC.io/issues/46.

Omar Al-Ithawi Al-Dolaimy MSc. Information Systems Security and Digital Criminology @ PSUT http://www.psut.edu.jo/ Blogger @ www.omardo.com

OmarIthawi commented 9 years ago

​Could you please tell me why are you doing it this way?​

On Sun, Jul 13, 2014 at 11:36 PM, Omar Al-Ithawi i@omardo.com wrote:

​This sounds like an XY problem http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem.

Please consider the following workarounds:

1) Put the webrtc.io and your expressjs server on different domains/subdomains e.g. webrtc.example.com and example.com respectively 2) Us​e another port and process for each instances,

You say that you have tried a lot, but you didn't say what have you tried!

On Sun, Jul 13, 2014 at 7:30 PM, Brian Berry notifications@github.com wrote:

Could somebody make webrtc.io compatible with express so i can use sockets from a server script and continue to use express. I've tried alot of things to make it work without success.

— Reply to this email directly or view it on GitHub https://github.com/webRTC/webRTC.io/issues/46.

Omar Al-Ithawi Al-Dolaimy MSc. Information Systems Security and Digital Criminology @ PSUT http://www.psut.edu.jo/ Blogger @ www.omardo.com

Omar Al-Ithawi Al-Dolaimy MSc. Information Systems Security and Digital Criminology @ PSUT http://www.psut.edu.jo/ Blogger @ www.omardo.com

calmchess commented 9 years ago

well I want to use express to easily serve files I want to use socket.io or its equivelent to do other things first I try to run socket.io , exspress and webrtc.io togeather then I see in what little doc there is on webrtc.io that it can make calls similar to socket.io so i try to run webrtc.io and express but it doesn't work well I tried 2 diffrent ports but the client won't allow it when using express ...my best guess here I tried to proxy and use cluster. unfortunatley my knowlege of nodejs is rudimentary and I'm only getting by with google.

/ var express0 = require('express'), app0=express0(), server0 = require('http').createServer(app0), webRTC = require('webrtc.io').listen(server0); var port0 = process.env.PORT || 8001; server0.listen(port0); /

webRTC = require('webrtc.io').listen(8001); var mysql = require('mysql');

var express = require('express'), app=express(), server = require('http').createServer(app),

//next line tries using webrtc.io instead of socket.io :( bad results. io= require('webrtc.io').listen(server); var port1 = process.env.PORT || 8002; server.listen(port1); //app.use(express.compress()); app.use('/', express.static(dirname + "/")); app.use('/js', express.static(dirname + "/js")); app.use('/css', express.static(dirname + "/css")); app.use('/images', express.static(dirname + "/images")); app.get('/',function(req, res){ res.header('Cache-Control', 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0'); res.sendfile(__dirname+'/roomsplash.html'); });

Above is some stuff I've tried. I don't what I'm doing all I know is I don't wanna stop.