rtc-io / rtc-switchboard

Node server side in memory signaller for rtc.io components
http://www.rtc.io/modules.html
57 stars 36 forks source link

wss:// 404 #20

Open max-mapper opened 9 years ago

max-mapper commented 9 years ago

Hi, im trying to do an experiment in screensharing:

var quickconnect = require('rtc-quickconnect')

var constraints = {
  audio: false,
  video: {
    mandatory: {
      chromeMediaSource: 'screen'
    },
    optional: []
  }
}

quickconnect('//rtc.io/switchboard/', { ns: 'screenshare-test', data: true, constraints: constraints }).on('dc:open', function(channel, peerId) {
  console.log(channel, peerId)
  // var video = document.createElement('video')
  // video.src = window.URL.createObjectURL(stream)
  // video.autoplay = true
  // document.body.appendChild(video)
})

to use the screen sharing API you must be on an https server. I'm using npm install crisp -g to do this locally in development.

When I run the above code (using browserify) I get the following error:

WebSocket connection to 'wss://rtc.io/switchboard/' failed: Error during WebSocket handshake: Unexpected response code: 404

Is wss:// supported? I can't use ws:// due to mixed protocol errors

DamonOehlman commented 9 years ago

Yeah wss:// is definitely supported.

Can you try using //switchboard.rtc.io/ rather than //rtc.io/switchboard? The actual service is running at that location there now, and I have some nginx redirects setup but they may only apply to HTTP traffic (which I'll need to fix).

DamonOehlman commented 9 years ago

Oh, and this is probably of interest too: https://github.com/rtc-io/rtc-screenshare

DamonOehlman commented 9 years ago

@maxogden I've just double-checked that it is all working and //switchboard.rtc.io/ definitely works when connecting from a page served via HTTPS. It's likely that you will still see that console.log entry you were talking about, though in actual fact it's working. This is because quickconnect is hitting a couple of different endpoints to determine which one is available (Basically I'm transitioning from using primus to not).

I'll look into suppressing that error message as it's pretty disconcerting and it took me a while to remember why it was there also...