Last active
May 15, 2019 13:25
-
-
Save andrewjmead/85f409783578037f65e99ba80b39fca7 to your computer and use it in GitHub Desktop.
Siva
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var https = require('https'); | |
var express = require('express'); | |
var app = express(); | |
var options = { | |
key: fs.readFileSync('./file.pem'), | |
cert: fs.readFileSync('./file.crt') | |
}; | |
var serverPort = 443; | |
var server = https.createServer(options, app); | |
var io = require('socket.io')(server); | |
// Configure express such as public directories | |
io.on('connection', function(socket) { | |
// Do something with the connection | |
}); | |
server.listen(serverPort, function() { | |
console.log('server up and running on port %s', serverPort); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment