Monday 11 September 2017

Switching a socket.io app to run with https

I have an app that was working just fine with HTTP, but now I upgraded my website to HTTPS and it doesn't work anymorethis is the error I get in the console:GET http://ift.tt/2eR4cQA net::ERR_CONNECTION_CLOSED and this is my server side code:var io = require('socket.io').listen(4000); var uh = require('./userhandler'); var fs = require('fs'); var path = require('path'); var userCount = 0; io.configure('production', function() { // io.set('origins', 'localhost:80'); io.set('log level', 1); io.enable('browser client minification'); io.enable('browser client etag'); io.enable('browser client gzip'); }); and this is my client side code:var socket = io.connect('http://ift.tt/2wWcsZc', {'sync disconnect on unload': true}); Can someone please help me fix it? Thanks

Submitted September 11, 2017 at 08:51PM by tigerosh

No comments:

Post a Comment