Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webrtc.io and express #46

Open
calmchess opened this issue Jul 13, 2014 · 3 comments
Open

webrtc.io and express #46

calmchess opened this issue Jul 13, 2014 · 3 comments

Comments

@calmchess
Copy link

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
Copy link

​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
#46.

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

@OmarIthawi
Copy link

​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
#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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants