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

Can't connect from the same network #229

Open
aravol opened this issue Feb 11, 2021 · 12 comments
Open

Can't connect from the same network #229

aravol opened this issue Feb 11, 2021 · 12 comments
Assignees
Labels
bug Something isn't working on hold waiting for traction or feedback

Comments

@aravol
Copy link

aravol commented Feb 11, 2021

🚩 Describe the bug

Two machines connected from the same LAN cannot connect to each other over Fari

🔢 Steps to reproduce

Host a table from Machine A
Copy Link, send to Machine B
Join game from Machine B
Enter name on name page
Wait...
Client console shows PeerJS: iceConnectionState changed to disconnected on the connection with <GUID>
Note <GUID> does NOT match the link guid
Server Console does not appear to acknowledge the connection attempt

🟢 Expected behavior

App connects or displays a clear error

🔴 Actual behavior

App never stops "loading" spinner

💅 Screenshots

image

🖥 Desktop or Smartphone

  • OS: Windows 10
  • Browser: Chrome
  • Device: Custom PC

📄 Additional context

@aravol aravol added the bug Something isn't working label Feb 11, 2021
@jmicu
Copy link

jmicu commented Feb 11, 2021

I have the same issue sometimes.

My usual workaround is to click Join repeatedly until it finally does so. It has worked every time, but the number of clicks needed varies

@aravol
Copy link
Author

aravol commented Feb 11, 2021

Going by this workaround, it should be noted that everyone else from outside my LAN was able to connect without incident

@RPDeshaies
Copy link
Collaborator

Interesting. I tried joining from the same browser, the same computer and even the same network using my computer and my phone (same wifi) and it's working fine so I will need to investigate a bit more to see if there's a fix for this.

@aravol
Copy link
Author

aravol commented Mar 4, 2021

Same result tonight. I might try pulling down a dev environment, but this is a complete dealbreaker for our campaign

@RPDeshaies RPDeshaies added the on hold waiting for traction or feedback label Mar 4, 2021
@RPDeshaies
Copy link
Collaborator

@aravol I investigated a bit more, and I just tested with multiple computers in my house and I sadly cannot reproduce this issue.

I think it could be isolated to the way your network/router/ISP is configured but its pretty hard for me to pinpoint.

It could also be related to this: https://github.com/fariapp/fari/wiki/Connection-issues

But since I cannot reproduce it on my end, I will need help to help find more details about this issue.

For now, I would recommend you use the offline mode and share your screen while players look at their character sheet on their end.

If that still doesn't work for you, well I'm sorry that it is a dealbreaker for your campaign.
I hope that one day the WebRTC protocol is going to be more stable, but this is out of my hands.

@trb1maker
Copy link

A similar problem. The error message does not appear, but in the console the message is:

WebRTC: ICE failed, your TURN server appears to be broken, see about:webrtc for more details
PeerJS:  iceConnectionState is failed, closing connections to bf01a645-1945-49c0-9b08-6138385d20a4 instrument.ts:129:35

Can I help figure out the reason?
console-export-2021-3-6_21-6-27.txt

@aaronanderson-github
Copy link

aaronanderson-github commented Apr 23, 2021

I encountered the same problem on Chrome on MacOS version 10.15.7 (Catalina), but clicking 'Join' repeatedly wasn't working. The problem may have something to do with anonymizing the local IPs exposed by WebRTC.

Workaround

I've found disabling anonymizing local IP addresses in your browser allows you connect. I'm no expert, but using these workarounds is a potential security concern, hence why the browsers are the set the way they are. If you insist of doing this, I advise you to use this workaround for the duration of playing then change it back.

This workaround may need to be done for both computers on your network, not just the one that can't connect.

Chrome

  1. type chrome://flags into your address bar at the top of the browser
  2. Search for Anonymize local IPs exposed by WebRTC in the search bar
  3. Set "Anonymize local IPs exposed by WebRTC" to Disable
  4. Relaunch Chrome and connect to the fari game

Firefox

Someone else may confirm this, but I believe the following steps are equivalent to the above Chrome workaround if you're encountering a problem using Firefox:

  1. type about:config in your address bar
  2. If "Proceed with Caution" appears, click Accept Risk and Continue
  3. Type in media.peerconnection.ice.obfuscate_host_addresses into the search bar
  4. Click the toggle button on the far right of media.peerconnection.ice.obfuscate_host_addresses so the value is changed to false
  5. Relaunch Firefox and connect to the fari game

On an potentially related note, comparing the console output of a successful connection against one that doesn't connect, I've found the successful one contains two additional lines:
instrument.ts:129 PeerJS: DC#dc_mcrc5mgzl3 dc connection success situated before the "Server message received" messages and,
instrument.ts:129 PeerJS: DC#dc_mcrc5mgzl3 dc onmessage: ArrayBuffer(4961) after the "Server message received" messages.
Whether this is helpful or not I'm not certain.

@aravol
Copy link
Author

aravol commented Apr 25, 2021

Was able to get it working with this above anonymization workaround, though it didn't work on only the host machine; needed to be applied to both machines

@aaronanderson-github
Copy link

aaronanderson-github commented Apr 25, 2021

Was able to get it working with this above anonymization workaround, though it didn't work on only the host machine; needed to be applied to both machines

Noted, I'll add that to the workaround.
Were both machines using the same browser to connect to the session? Such as both using Chrome?

@RPDeshaies
Copy link
Collaborator

This is a very nice investigation @FastCarrot and happy to see that it worked for you @aravol !

Perhaps this workaround could be added to the wiki so that everyone can benefit from this ?
We could also include a link to the flag directly for chrome like chrome://flags/#enable-webrtc-hide-local-ips-with-mdns

https://github.com/fariapp/fari/blob/master/docs/fari-wiki.md#connection-issues

@RPDeshaies
Copy link
Collaborator

I still find it weird that this flag is needed only for certain users and not all of them. I'm no network expert so if anyone knows and would like to enlighten me, please do.

@klashe1977
Copy link

Hello, I'm having the same issue. Two computers, same LAN, cannot connect to each other.
I also tried having one of the computers connect to a VPN, and same issue occurred.

My workaround was to set up a local hotspot on my phone and have one player connect to that hotspot. Then I was able to establish the connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working on hold waiting for traction or feedback
Development

No branches or pull requests

6 participants