cjb / serverless-webrtc Goto Github PK
View Code? Open in Web Editor NEWA demo of using WebRTC with no signaling server.
License: Other
A demo of using WebRTC with no signaling server.
License: Other
When you are sending data to fileReceiver you are sending unparsed object "e.data" not json parsed "data" variable. File transfer doesn't work, because it is expecting json parsed object.
Hello! The idea itself is awesome, but when I try to establish a connection, I got this:
Uncaught RangeError: Maximum call stack size exceeded.
at HTMLDivElement.trigger (https://cjb.github.io/serverless-webrtc/js/jquery-2.0.0.js:4773:11)
at Object.trigger (https://cjb.github.io/serverless-webrtc/js/jquery-2.0.0.js:4502:60)
at HTMLDivElement.<anonymous> (https://cjb.github.io/serverless-webrtc/js/jquery-2.0.0.js:5055:17)
at Function.each (https://cjb.github.io/serverless-webrtc/js/jquery-2.0.0.js:590:23)
at init.each (https://cjb.github.io/serverless-webrtc/js/jquery-2.0.0.js:237:17)
at init.trigger (https://cjb.github.io/serverless-webrtc/js/jquery-2.0.0.js:5054:15)
at init.jQuery.fn.(anonymous function) [as focus] (https://cjb.github.io/serverless-webrtc/js/jquery-2.0.0.js:6657:9)
at HTMLDocument.<anonymous> (https://cjb.github.io/serverless-webrtc/js/bootstrap.js:910:27)
at HTMLDocument.dispatch (https://cjb.github.io/serverless-webrtc/js/jquery-2.0.0.js:4618:9)
at HTMLDocument.elemData.handle (https://cjb.github.io/serverless-webrtc/js/jquery-2.0.0.js:4302:28)
I'm trying to connect my phone (Meizu m3s, Android, latest Chrome) and my PC (Windows, latest Chrome). Both are connected to same wifi network. It doesn't matter if it's a local file or hosted page, the error appears anyway.
There are unanswered pull requests
Large (>100KB) file transfers sometimes fail silently, sometimes hang the browser. I don't know why yet.
Hello,
I am trying out serverless-webrtc. I clone repo and try it out in browser (chrome 53, firefox 49b) and with node.js. I also try live demo and get same errors.
In node.js if I try to create room I get: "Invalid call to createOffer - function must either have prototype ([config]) or (successCallback, failureCallback, [config])."
In node.js if I try to join: "Unexpected token H in JSON at position 0"
In html if I try to create offer it doesn't work and same error as with Node.js: "Uncaught SyntaxError: Unexpected token H in JSON at position 0"
In html if I try to join the room I get error: "Uncaught SyntaxError: Unexpected token H in JSON at position 0 (anonymous function) @ serverless-webrtc.js:62dispatch"
Am I missing something or why is it not working?
*EDIT:
I guess I have to have a web camera to work properly. :) I am getting this error: "Error adding stream to pc1: [object NavigatorUserMediaError]"
Is it possible to work without web camera?
I wonder if I am missing something, aren't you using Google's signaling server here?
https://github.com/cjb/serverless-webrtc/blob/master/serverless-webrtc.js#L25
Jquery appears to throw an error an prevent supplanting the string that was the local offer leaving it empty. Here is the full console log
This appears to be Chrome
jquery-2.0.0.js:4773 Uncaught RangeError: Maximum call stack size exceeded.jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237jQuery.fn.extend.trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910jQuery.event.dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302jQuery.event.trigger @ jquery-2.0.0.js:4536jQuery.event.simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945jQuery.event.special.focus.trigger @ jquery-2.0.0.js:4773jQuery.event.trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055jQuery.extend.each @ jquery-2.0.0.js:590jQuery.fn.jQuery.each @ jquery-2.0.0.js:237
serverless-webrtc.js:156 video1
https://www.reddit.com/r/ipfs/comments/8pi62d/ipfs_webrtc_chat/
From u/rictic
In Chrome 68 I get this stack trace in the console, and the offer never shows up when I click Create:
Uncaught RangeError: Maximum call stack size exceeded.
at HTMLDivElement.trigger (jquery-2.0.0.js:4773)
at Object.trigger (jquery-2.0.0.js:4502)
at HTMLDivElement.<anonymous> (jquery-2.0.0.js:5055)
at Function.each (jquery-2.0.0.js:590)
at init.each (jquery-2.0.0.js:237)
at init.trigger (jquery-2.0.0.js:5054)
at init.jQuery.fn.(anonymous function) [as focus] (https://ipfs.io/ipfs/QmSJpwAeKraihyxpSHqAurautEbCU277UyBHUdaapbZX7F/apps/serverless-webrtc/js/jquery-2.0.0.js:6657:9)
at HTMLDocument.<anonymous> (bootstrap.js:910)
at HTMLDocument.dispatch (jquery-2.0.0.js:4618)
at HTMLDocument.elemData.handle (jquery-2.0.0.js:4302)
When I visit https://cjb.github.io/serverless-webrtc/serverless-webrtc.html with Chrome or Firefox, the offer block stays empty. Chrome's console says:
This appears to be Chrome
jquery-2.0.0.js:4773 Uncaught RangeError: Maximum call stack size exceeded.trigger @ jquery-2.0.0.js:4773trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055each @ jquery-2.0.0.js:590each @ jquery-2.0.0.js:237trigger @ jquery-2.0.0.js:5054jQuery.fn.(anonymous function) @ jquery-2.0.0.js:6657(anonymous function) @ bootstrap.js:910dispatch @ jquery-2.0.0.js:4618elemData.handle @ jquery-2.0.0.js:4302trigger @ jquery-2.0.0.js:4536simulate @ jquery-2.0.0.js:4829handler @ jquery-2.0.0.js:4945trigger @ jquery-2.0.0.js:4773trigger @ jquery-2.0.0.js:4502(anonymous function) @ jquery-2.0.0.js:5055each (....)
serverless-webrtc.js:156 video1
serverless-webrtc.js:176 Error adding stream to pc1: [object NavigatorUserMediaError]
Firefox's console says:
This appears to be Firefoxadapter.js:8:3
Les interfaces WebRTC comportant le préfixe « moz » (mozRTCPeerConnection, mozRTCSessionDescription, mozRTCIceCandidate) sont obsolètes.serverless-webrtc.js:13:10
RTCIceServer.url is deprecated! Use urls instead.serverless-webrtc.js:13
L’utilisation de « getPreventDefault() » est obsolète. Utiliser « defaultPrevented » à la place.jquery-2.0.0.js:4859:28
onaddstream is deprecated! Use peerConnection.ontrack instead.serverless-webrtc.js:194
RTCIceServer.url is deprecated! Use urls instead.serverless-webrtc.js:238
onaddstream is deprecated! Use peerConnection.ontrack instead.serverless-webrtc.js:297
video1serverless-webrtc.js:156:3
navigator.mozGetUserMedia a été remplacé par navigator.mediaDevices.getUserMediaserverless-webrtc.js:161:2
Error adding stream to pc1: NotFoundError: The object can not be found here.serverless-webrtc.js:176:5
On Edge I can't even click on "Create" (error = "object expected")
Is there a solution?
Am I the only one having this issue?
I am trying establish webrtc session between android device and laptop over wifi(does not have access to internet) using chrome browser.
Connection never get establish after exchanging the webrtc offer and answer between android and laptop.
But it works on firefox.
Running from file:///
If the person joining clicks "OK, I sent it" on the offer (2nd) dialog box before the creator clicks "OK, I pasted it", the backdrop doesn't disappear even though the connection is made and everything works. If I manually remove the
If I open up the hosted demo it works just fine in Chromium. If I clone the git repo and open it locally, it doesn't work in Chromium but does work in Chrome. What's going on? I want to use this script in Electron.js. Why would it work locally in Chrome but not Chromium? I haven't tried it in Electron yet but I'm hoping it will work. I don't want to run a python script.
Is there some difference between the hosted demo and what's in the git repo?
Chrome doesn't support "reliable" (TCP) datachannels yet, but that's not the only reason this app doesn't work in Chrome. It would be great to at least fix the other reasons.
Hi,
I have this issue:
root@vm3:~/node_modules/serverless-webrtc# node serverless-webrtc.js --create
/home/jaricek/node_modules/wrtc/lib/peerconnection.js:215
throw new Error('Invalid call to createOffer - function must either have
^
Error: Invalid call to createOffer - function must either have prototype ([config]) or (successCallback, failureCallback, [config]).
at RTCPeerConnection.createOffer (/home/jaricek/node_modules/wrtc/lib/peerconnection.js:215:13)
at makeOffer (/home/jaricek/node_modules/serverless-webrtc/serverless-webrtc.js:145:6)
at Object. (/home/jaricek/node_modules/serverless-webrtc/serverless-webrtc.js:41:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:945:3
root@vm3:~/node_modules/serverless-webrtc#
Any idea have I can fix it ? thx
Sorry if this is out of the scope of this project but if I wanted to build say a C++ client using QT to connect to peers in their browser, how do I connect to the peers? What is the nodejs native client leveraging to be able to do that?
TypeError: Not enough arguments to mozRTCPeerConnection.setLocalDescription.
pc1.setLocalDescription(desc, function () {});
Hello!
I've tried to chat with a friend, but we weren't able to connect to each other.
We used the browser demo link with a Firefox Browser.
When we looked at the offer or answer string we could only detect our local IP addresses but not the public ones.
Shouldn't this be the public addresses?
It seems to be a problem related to the STUN server connection.
I've changed the url to "stun:stun.l.google.com:19302" to try another server, but it still didn't solve the problem...
Is someone facing the same problem or has some advices?
Thanks in advanced
I am getting this error . UNABLE TO FIND NATIVE MODULE when I run it on Node Js
Sending that text to my next door neighboor is just going to scare him out.
I wonder what are the ways we could do this (beyond QR codes)
Open for ideas:
Is it possible to get a progress callback in Firefox?
I'm working on a text-only fork of this project.
Is there a way to create an offer without a stream object?
Then mark the gh-pages branch as the "default" in your Github settings, and delete the master branch.
Same as before, but all of a sudden you'll have a demo URL to point to, at http://cjb.github.io/serverless-webrtc/serverless-webrtc.html.
jquery gets callstack exceeded because the previous modals are not "hide" before the next modal is "show".
getUserMedia in adaptor.js detection doesn't identify chrome... additionally.. if not in HTTPS, getUserMedia doesn't exist.. This can be trivially shimmed around, allowing the datachannel (chat) to work.
There is a loong delay between offer generation and the ICE server result.. 30 seconds or so each way on my setup.. Is this normal?.. would be cool if this was wrapped into a small library.
Cool project!
Here is a PR with what I had to break to get this to work on Chrome/Windows:
Had to force "hide" any open modals before "show" ing the next one, or jquery gets a stack overflow...
I fixed it for the host, but might not have for the client, but it all eventually works...
i wasn't able to test this because the demo is broken, but https://github.com/cjb/serverless-webrtc/blob/master/js/serverless-webrtc.js#L314 injects messages as HTML without escaping. so if alice sends <script>alert('hi')</script>
to bob in the chat log, it may get executed in bob's browser (https://github.com/cjb/serverless-webrtc/blob/master/js/serverless-webrtc.js#L146)
Does this work in a closed network (f.e. on a wifi network with no internet)?
I'd like to connect two devices by running code in each device's browser. They are on the same network via WiFi, without internet.
Is this what can be done?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.