I have a strange issue in FF which is not reproduced in Chrome: websocket connection to another origin does not work when using SSL connection.
My Rails app is running on https://wax.lvh.me:3000
and socket.io node JS app is running on https://wax.lvh.me:3001
. When I try to connect to the socket from the Rails app in FF I see the following warnings in the browser's dev console:
When I open the Network tab I see the following response headers - notice that there are no access-control headers in the response:
I tried to use the following recipes from the others SO answers:
Set up origins to '*:*'
from this answer
io = require('socket.io').listen(server)
io.set('origins', '*:*');
Set up origins to a function from this answer
io.origins (origin, callback) =>
if origin.match(/lvh\.me/)
return callback(null, true)
callback('Origin not allowed', false)
But nothing helped me to fix this issue so far
Notice that access-control headers are set correctly in Chrome:
I use the following browser and tool versions:
- Firefox - 63.0.3 (64-bit)
- Google Chrome - Version 73.0.3683.39 (Official Build) beta (64-bit)
- Socket.io - 2.2.0
Do you have any ideas how to set up CORS in socket.io for FF correctly?