1

I am trying to implement a WebRTC application using the xirsys API and simpleWebRTC. I am trying to connect using the secure method. So inside the connect.js file, I have this:

var xirsysConnect = {
   secureTokenRetrieval : true,
   server : '../getToken.php/',
   data : {
      domain : 'MY_DOMAIN_HERE',
      application : 'default',
      room : 'default',
      secure : 1
   }
};

When I open the page in a browser, I get this error in the console:

Failed to construct 'WebSocket': The URL 'undefined/v2/LONG_STRING_HERE' is invalid

I can't seem to find any help in the docs. I have also tried looking in the source code, but can't seem to make any headway. Any help will be greatly appreciated.

NaijaProgrammer
  • 2,892
  • 2
  • 24
  • 33

1 Answers1

0

For having spent the last couple of days trying to make this work, I concluded that the Xirsys demo using simpleWebRTC isn't ready for prime time. Comments in the source code often don't reflect what's in the code itself. Additionally, there is, indeed, no proper online documentation about it.

I had hoped for Xirsys to provide something more professional. I'm looking forward to clarifications and improvements on their side.

BernardV
  • 1,700
  • 20
  • 15
  • The issue you're having is due to the Websocket service domain not being referenced correctly when the Socket URL is created. There can be a couple of reasons for this, but the one that is most common is simply not providing the simplewebrtc.connection.js lib with the example app. If missing, the URL variable is not setup in the xirsys.signal.js constructor and the whole URL fails to form. Can you please check this is indeed loading? – LeeSylvester Jan 09 '17 at 21:26