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

Peer connects, but DataConnection doesn't open, on Edge #899

Open
TotoShampoin opened this issue Nov 14, 2021 · 9 comments
Open

Peer connects, but DataConnection doesn't open, on Edge #899

TotoShampoin opened this issue Nov 14, 2021 · 9 comments
Labels
bug client related to peerjs client platform-specific issues affecting only specific platforms

Comments

@TotoShampoin
Copy link

I made this little code for testing

var peer = new Peer();

peer.on('open', function(id) {
    console.log(id);
});

peer.on('connection', function(conn) {
    makeconn(conn);
})

function connect(id) {
    let conn = peer.connect(id);
    makeconn(conn);
}

function makeconn(conn) {
    console.log('connection...');
    conn.on('open', function() {
        conn.on('data', function(data) {
            console.log(data);
        });
        conn.send('Hello!');
        console.log('ready');
    });
}

window.connect = connect;

But when I run it on localhost and use the little connect function, both consoles tell me 'connection...' but don't go further, meaning both browsers recognize a connection, but don't open it, making all communication impossible.

It only applies to Edge (Chrome), while Firefox to Firefox works just fine.

Tried PeerJS 1.3.1 and 1.3.2, same result

And here is the html, in case you wonder
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="https://unpkg.com/[email protected]/dist/peerjs.min.js"></script>
    <script src="./script.js" type="module"></script>
</body>
</html>
@TotoShampoin TotoShampoin changed the title Peer connects, but DataConnection doesn't open, on Chrome Peer connects, but DataConnection doesn't open, on Edge Jan 17, 2022
@TotoShampoin
Copy link
Author

PeerJS seems to work fine on Chrome and Firefox, but it's still not working on MS Edge, and Safari as I checked earlier

@afrokick afrokick added platform-specific issues affecting only specific platforms bug labels Feb 20, 2022
@PavelSafronov
Copy link

I'm experiencing the same issue.

@afrokick , you've added the tags 'browser issue' and 'bug'. Can you clarify what's known at this moment? Is this a bug in Edge/Safari? Or a bug in PeerJs?

@shahriarhossain
Copy link

It works with Chrome, but it doesn't work with Brave, Edge. Is there any workaround?

@bruncanepa
Copy link

It works with Chrome, but it doesn't work with Brave, Edge. Is there any workaround?

@shahriarhossain I made it work with Brave

  1. Go to Brave settings.
  2. Search for webrtc
  3. Change WebRTC IP handling policy option to Defaultor Default public and private

@TotoShampoin
Copy link
Author

I don't think it's a good solution to change the browser settings in a web app, because the users might face the issue too

@bruncanepa
Copy link

I don't think it's a good solution to change the browser settings in a web app, because the users might face the issue too

It's a config I changed the default value for more privacy. Normal users won't do that. I know is not the best, but I was just trying to help.

@irgalamarr irgalamarr added the client related to peerjs client label Feb 24, 2024
@davidquintard
Copy link

What about this issue with edge and safari?
Did someone found a workaround ?

@davidquintard
Copy link

However it seems to work since 2019.
#725
https://caniuse.com/rtcpeerconnection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug client related to peerjs client platform-specific issues affecting only specific platforms
Projects
None yet
Development

No branches or pull requests

7 participants