buildar / getting_started_with_webrtc

Example code to help you get started creating WebRTC applications
MIT License
79 stars 39 forks source link

Stuck at "One moment please...connecting your call..." #1

Closed yepher closed 10 years ago

yepher commented 10 years ago

I am reading through the book "Getting Started with WebRTC".

I installed node.js and websockets. I am running "node webrtc_signal_server.js".

If I open two tabs in chrome and hit "http://192.168.200.209:1234/#1390508125279-5240" it works just fine. But I I do the same test from two machines both browsers say "One moment please...connecting your call...".

This is what I see in the Chrome browsers javascript console:

setting up local video stream (index):368
setting up connection to signaling server (index):148
you are the Callee (index):180
updating UI to loading_state (index):209
sending 'join' signal for call token:#1390508677469-5908 (index):190
sending 'callee_arrived' signal for call token:#1390508677469-5908 (index):199
new local stream added (index):376
local stream added to peer_connection to send to remote peer 

Any idea what might be going wrong?

yepher commented 10 years ago

Ok, as soon as I submitted this issue I thought to grep the code for localhost and I found the following line:

video_call_with_chat_and_file_sharing.html:  signaling_server = new WebSocket("ws://localhost:1234");

If I change that to my IP address it works just fine. Is this expected?

buildar commented 10 years ago

Hi Chris, yep that's correct. If you want to access the node server from different computers then you need to update the script to use an IP address that is accessible to all of them. The shorthand "localhost" is just mapped to 127.0.0.1 which is only accessible on that local computer.

Also, please make sure you use the latest code from github. There was a race condition in the call setup that's been fixed in that code. See the use of the "local_stream_added" variable to see more info.

And please let us know if you have any other questions or issues.

Thanks.

yepher commented 10 years ago

Thanks for the info. The README.md is mis-leading. It seem to read that it should work out of the box from different hosts. It is clear to me now. And thanks for the update.

buildar commented 10 years ago

Hi Chris, thanks for the feedback. I've updated the README.md to make sure that's 100% clear.

Let me know if you have any other suggestions.

AnushaTeleparadigm commented 8 years ago

If i use localhost it is working fine but if i use my ip address it is struck at One moment please...connecting your call.