-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Self-hosted Screen-Sharing #56
Comments
All io.sockets.on('connection', function (socket) {
socket.on('message', function (data) {
socket.broadcast.emit('message', data);
});
}); And here is the client-side code overriding connection.openSignalingChannel = function(callback) {
return io.connect().on('message', callback);
}; Try New Screen Sharing Demo. Source Code Expectations for custom signaling gateways
That socket instance must have a // declaring custom "send" method
socket.send = function(data) {
xhr.post('/controller/action', data);
}; WebSockets for signlaingconnection.openSignalingChannel = function (callback) {
var websocket = new WebSocket('ws://domain:protocol/');
// data from "onmessage" must be passed over "callback" object
websocket.onmessage = function (e) {
callback(e.data);
};
// socket object must be returned for reusability
return websocket;
}; WebSync for signalingconnection.openSignalingChannel = function (callback) {
var username = Math.round(Math.random() * 60535) + 5000;
var client = new fm.websync.client('websync.ashx');
client.setAutoDisconnect({
synchronous: true
});
// received message must be passed over "callback" object
client.connect({
onSuccess: function () {
client.join({
channel: '/namespace',
userId: username,
userNickname: username,
onReceive: function (event) {
callback(event.getData().text);
}
});
}
});
// must have a "send" method
return {
send: function (message) {
client.publish({
channel: '/namespace',
data: {
username: username,
text: message
}
});
}
};
}; XHR for signalingconnection.openSignalingChannel = function (callback) {
var messages = {};
function repeatedlyCheck() {
xhr('/GetData', function (data) {
if (data != false && !messages[data.ID]) {
messages[data.ID] = data.Message;
// data must be passed over "callback" object
callback(data.Message);
setTimeout(repeatedlyCheck, 1);
} else setTimeout(repeatedlyCheck, 400);
});
}
repeatedlyCheck();
// if there is no "send" method
// must declare one
// also socket instance must be returned
return {
send: function (data) {
xhr('/PostData', null, data);
}
};
}; |
Hello, @muaz-khan Is it possible to share desktop screen without using any extension ? Just by capturing the screen stream and displaying it ?? what constraints should i use ?? |
I noticed the Pluginfree-Screen-Sharing is using the services at firebaseio.com
Is that possible to self hosted it?
Which node.js file we could use to start the services?
Thanks,
The text was updated successfully, but these errors were encountered: