mafintosh / signalhub

Simple signalling server that can be used to coordinate handshaking with webrtc or other fun stuff.
MIT License
667 stars 97 forks source link

Doesn't work with firefox #32

Open robbiemu opened 6 years ago

robbiemu commented 6 years ago

Firefox won't auto-recognize json data so you actually ahve to set the content type. Otherwise, it fails out with invalid xml errors -- for example, on the /all request.

On my own server, a solution was found by changing onRequest in server.js:

  var onRequest = cors(function (req, res) {
    res.setHeader('Content-Type', 'application/json; charset=utf-8')

and removing the same in the section(s) below that had it.

louiscenter commented 6 years ago

@robbiemu would you be able to submit a PR for this? :)