jeremyckahn / chitchatter

Secure peer-to-peer chat that is serverless, decentralized, and ephemeral
https://chitchatter.im/
GNU General Public License v2.0
1.52k stars 191 forks source link

Yunohost ChitChatter NAT issue #171

Closed ralphshinevar closed 12 months ago

ralphshinevar commented 12 months ago

Room URL

https://video2.shinevar.nohost.me

Room Subject

Fixing STUN/TURN when ChitChatter behind a NAT address

ralphshinevar commented 12 months ago

Hello Jeremy. I reinstalled ChitChatter on my Yunohost server, version 1.0~ynh9. Made sure 404.html, package.json and /src/config/rtcConfig.ts were correct. Behind the NAT, all can access a public room. However, anyone outside the NAT is put in the room, but cannot see anyone else. So the ice servers in the rtcConfig.ts cannot traverse the NATted IPs:

iceServers: [ { urls: 'stun:188.148.133.173:3478', }, { urls: 'turn:188.148.133.173:3478', username: 'c386d75b5633456cb3bc13812858098d', credential: '58fd06d85fe14c0f9f46220748b0f565', }, { urls: 'turn:188.148.133.173:3478', username: '0e2f563eacfd4c4a82ea239b04d1d494', credential: '8179b4b533f240ad9fe590663bef1bc9', }, { urls: 'turn:188.148.133.173:3478', username: 'feab95c3fcd147a2a96a3d3590bf9cda', credential: '654cafd885424b7fb974e65f631f25f9', }, ], }

jeremyckahn commented 12 months ago

@ralphshinevar https://video2.shinevar.nohost.me/ is still using an old version of Chitchatter. Please work with Yunohost to get it updated.

I reinstalled ChitChatter on my Yunohost server, version 1.0~ynh9. Made sure 404.html, package.json and /src/config/rtcConfig.ts were correct. Behind the NAT, all can access a public room. However, anyone outside the NAT is put in the room, but cannot see anyone else.

Does this happen with https://chitchatter.im/?

ralphshinevar commented 12 months ago

Yes this happens as well on https://chitchatter.im/

jeremyckahn commented 12 months ago

Got it, thanks for letting me know @ralphshinevar. This seems like an issue with the TURN server that Chitchatter is using. I don't know that there's much that I can do to fix this, as I don't control that TURN server (it is offered as a courtesy by a member of the Chitchatter community) or the implementation of WebRTC (which is what Chitchatter uses to connect peers). Conceivably this issue could be resolved with a different TURN server implementation or configuration, but that is outside the scope of this project.

I'll close this issue for now, but please update this thread if you are able to find a workaround for this.

ralphshinevar commented 12 months ago

Hey Jeremy. I also have Galene on my Yunohost server, which comes with a built-in turn server. I used Galene's turn credentials and it worked!!! I understand a TURN server is not peer-to-peer but my Yunohost ChitChatter is working.

jeremyckahn commented 12 months ago

Hey Jeremy. I also have Galene on my Yunohost server, which comes with a built-in turn server. I used Galene's turn credentials and it worked!!! I understand a TURN server is not peer-to-peer but my Yunohost ChitChatter is working.

@ralphshinevar oh great! I think that confirms the theory that this issue is with the default TURN server that Chitchatter uses by default. I don't have access or visibility into that server. @sini6a set this up originally (🙏), so perhaps he has some insight.