kmturley / webrtc-radio

Broadcast and listen to WebRTC audio streams on a local network using peer-to-peer connections
31 stars 2 forks source link

Not working outside LAN connections #18

Open juliangorge opened 1 year ago

juliangorge commented 1 year ago

Hello @kmturley ! I really appreciate your time in this project. I have been trying to build a docker image to use it in AWS EC2 instance (also to make compatible with those libraries versions, etc). With no-changes applied in code, I deployed it and successfully connected with devices inside the same LAN net, but when I try to listen a "remote" broadcast, I don't receive any error or message or signal.

I could find what exactly is wrong, and I will be so grateful if you can give me one hand.

Regards!

kmturley commented 1 year ago

Hello, Thanks for trying out my prototype. As mentioned in the README, I only tested it on local networks. It was out-of-scope of the project to also have a hosted version.

However in theory you should be able to get it to work. Key things to check/configure:

juliangorge commented 1 year ago

Hello Kim, you do not know how I appreciate your time in your response.

Actually, I checked these 1-2 bullet points, but I can not understand how to debug client and server functionality. Although I will continue trying to. I think it need ICE (Stun and TURN) settings to work fine across any device/NAT/Firewall configuration. Do you consider add it for a new release? :)

Again, thank you for your time. Regards

kmturley commented 1 year ago

I'm not familiar with ICE (Stun and TURN), would need to investigate more.

But a quick search found this code:

const configuration = {iceServers: [{urls: 'stun:stun.example.org'}]};
const pc = new RTCPeerConnection(configuration);

https://web.dev/webrtc-infrastructure/#code-webrtc-for-signaling

Compared to my code where I don't pass a configuration:

this.conn = new RTCPeerConnection();

https://github.com/kmturley/webrtc-radio/blob/master/src/app/shared/services/listener.service.ts#L28

I will mark this as a feature request. Although I don't have time to look at it now. Can revisit at a later date, or accept a PR if someone can implement.