Solved: https mit Node.js

var fs = require(‚fs‘);
var app = require(‚express‘)();
var server = require(‚https‘).createServer(
{
key: fs.readFileSync(‚./domain.key‘),
cert: fs.readFileSync(‚./domain.crt‘),
requestCert: false,
rejectUnauthorized: false
}, app).listen(1337, function(){
console.log(‚listening on *:1337′);
});
var io = require(’socket.io‘)(server);
io.sockets.on(‚connection‘, function (socket) {
console.log(„new client“);
socket.on(‚disconnect‘, function() {
console.log(„A client has left us :(„);
});
});

via Stackoverflow

2 thoughts on “Solved: https mit Node.js”

Kommentare sind geschlossen.