I'm using peerjs local server and open 2 browsers on same computer , I can send data from 1 browser to the second, but can't send from the second to the first.
In debug I can see the connection of the first browser is open and the second is close. I have 2 question:
If 1 browser calls this.peer.connect('secondBrowser', {reliable:
true}); , it created a datachannel that is two ways ?
should each browser call 'connect' to the other browser in order to
make a two way data transfer ?
In console at 1st browser the log is :
Open connection to peer y6wfmyb0bg7jlan5
The 2nd browser is
PeerJS: Added ICE candidate for: 76xtuwxoiclxzvq3
Apparently the data channel created by peer.js is not two way channel.
So you have to connect from both browser.
Related
I've created a webrtc app on localhost. Because the input video and output video is coming from the same camera, I can't visually determine if the webrtc connection is indeed working correctly.
I went to chrome://webrtc-internals/, to inspect the details, but I am not sure which one tells me if connection is working. Is there some flag that I can check, perhaps on RTCPeerConnection object or in webrtc-internals, to determine if the connection is indeed successful?
If the connection is established successfully, then you will be seeing this in chrome://webrtc-internals/
24/07/2019, 16:54:53
signalingstatechange
stable
and
24/07/2019, 16:55:09
iceconnectionstatechange
completed
I am trying to make a one to one audio call using webRTC.
I have been looking through some of the source code on https://github.com/shanet/WebRTC-Example/blob/master/client/webrtc.js but I realized it has a middle man "iceServers" located at.
var peerConnectionConfig = {
'iceServers': [
{'urls': 'stun:stun.services.mozilla.com'},
{'urls': 'stun:stun.l.google.com:19302'},
]
};
I need my software to work when two peers are connected on the same network without internet connection. Could someone help me locate some examples or ideas if webRTC is possible?
Thank you.
Yes. It is possible. Just set the ice servers to an empty array (remove the stun and the turn servers) and all should be fine on a local network.
Take care about Chrome HTTPS/WSS requirements (Chrome will not allow the media permission if your website is not on HTTPS which is a bit difficult to setup on a local LAN without any internet connection). Firefox and Edge doesn't have such requirements.
I'm building a distributed system with websockets. Browser clients can connect to each other directly or to a central server. I would like to test a few distributed use cases end-to-end.
Example 1:
Open Browser A and connect to my site
Open Browser B and connect to my site
Browser A sends a chat message to Browser B
Confirm that Browser B received the message
Example 2:
Open Browser A and connect to my site
Open Browser B and connect to my site
Browser A sends a chat message to Browser B
On Browser B, a "disconnect" button is clicked
Confirm that Browser B does not receive the message
On Browser B, a "reconnect" button is clicked
Confirm that Browser A received the message
How can I do this? I've seen selenium running in parallel, but I haven't seen anything that allows you to coordinate the interaction between browsers.
Your test can open many webdriver instances.
If you open 2 instances in your test, one can represent browser A and the other browser B.
Call methods on these objects to simulate the scenario you discuss in your post.
To achieve this you need to use RemoteWebDriver. If all hosted locally, you will get two unconnected browsers on your computer. If you use a Grid, then you will get 2 browsers somewhere on your grid, probably on different machines.
If you want complete control, you could just start Selenium instances on two remote machines and use these hard coded machine names for A and B. In this scenario there would be no Grid.
Word of warning though. If you try to host all browsers locally, you cannot use IE as multiple IE all share common data where as Chrome are completely separate
If I open http://chatphrase.com/test/ in two browser tabs (either on the same machine or different machines - I'm testing using Google Chrome for both) and enter the same word in both, the two tabs seem to perform the ICE / STUN / SDP handshaking successfully and connect to each other, but the remote video element, despite having the remote stream attached, remains blank (and hovering over the element causes it to shrink to 2x2).
https://apprtc.appspot.com/ works fine. What is my site doing wrong?
This seems to be an exclusively client-based issue, but for what it's worth, my server-side code is at https://github.com/stuartpb/chatphrase/blob/master/app.js .
When the ICE candidates come in, they're not being added to the peer connection:
https://github.com/stuartpb/chatphrase/blob/99ce85330594026d70d5f9441cc06be6c4904b7e/static/chatphrase.js#L44
https://github.com/stuartpb/chatphrase/blob/99ce85330594026d70d5f9441cc06be6c4904b7e/static/chatphrase.js#L76
https://github.com/stuartpb/chatphrase/blob/99ce85330594026d70d5f9441cc06be6c4904b7e/static/chatphrase.js#L168
addIce(resbody.ice); should be addIce(peercon,resbody.ice);.
(I wrote this function somewhere around 4AM, right around the time that you start forgetting the signatures of functions you just wrote.)
Anyone any idea why browserstack might be constantly requesting localhost:45691. When I open browserstack in Chrome I get this request continuously.
XMLHttpRequest cannot load localhost:45691. Origin http://www.browserstack.com is not allowed by Access-Control-Allow-Origin.
In FF its showing a JS file causing the issue
localhost:45691/
http://www.browserstack.com/assets/bsjs.js?1376347645
Anyone having this issue? I even sent a report to browser stack 3 days ago and nothing either. This is driving me crazy.
BrowserStack provides a feature of Local Testing via Command Line Tunnel. To check if tunnel is connected or not, their JavaScript(JS) tries to talk to a http server which runs on port 45691 inside BrowserStackTunnel.jar.
When you don't have this Command Line Tunnel set, then the JS gets these errors, which turns to 200 OK response as soon as tunnel gets connected.