mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	trying to fix https issue
This commit is contained in:
		@@ -1,8 +1,20 @@
 | 
			
		||||
var fs = require('fs');
 | 
			
		||||
var http = require('http');
 | 
			
		||||
var https = require('https');
 | 
			
		||||
var privateKey  = fs.readFileSync('/etc/apache2/ssl/private.key', 'utf8');
 | 
			
		||||
var certificate = fs.readFileSync('/etc/apache2/ssl/ssl.crt', 'utf8');
 | 
			
		||||
 | 
			
		||||
var credentials = {key: privateKey, cert: certificate};
 | 
			
		||||
// your express configuration here
 | 
			
		||||
 | 
			
		||||
//var httpServer = http.createServer(app);
 | 
			
		||||
var httpsServer = https.createServer(credentials, app);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
var express = require('express');
 | 
			
		||||
var app = express();
 | 
			
		||||
var server = require('http').createServer(app);
 | 
			
		||||
var io = require('socket.io')(server);
 | 
			
		||||
//var server = require('http').createServer(app);
 | 
			
		||||
var io = require('socket.io')(httpsServer);
 | 
			
		||||
 | 
			
		||||
//db
 | 
			
		||||
var mongojs = require('mongojs');
 | 
			
		||||
@@ -14,7 +26,7 @@ var crypto = require('crypto');
 | 
			
		||||
var port = 3000;
 | 
			
		||||
var lists = [];
 | 
			
		||||
 | 
			
		||||
server.listen(port, function () {
 | 
			
		||||
httpsServer.listen(port, function () {
 | 
			
		||||
  console.log('Server listening at port %d', port);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user