Releases: mlaanderson/coffeecat
Only global installs create service
Only global installations will attempt to create a service and the configuration and applet directory structure.
Bug Fix
Service Installation
Install has been verified on Linux, Windows and Mac OS.
On Mac OS, Windows, and Linux the installation will create a service. On Mac node-mac is used to create the service, on Windows we use node-windows, but on Linux the init scripts or systemd service script is created directly.
On Mac OS the service still runs as root. I'm still investigating the correct way to run the service on Mac.
Coffeecat should work on FreeBSD and other Unix OS's, but for now just the executable is setup, it won't create the service. The file to run is in ${GLOBAL_MODULES_ROOT}/coffeecat/bin/coffeecat.js, it can be executed.
WebSocket Server Improvments.
WebSocket handling was not standard in v1.x.x. In v2.0.0 the server only routes the UPGRADE request to the applet, and the applet handles the WebSocket server. If the applet has a session created using the setSession
method, then the session will be added to upgrade request before the connection
event is fired.
Example Applet with WebSocket Server:
class HelloApplet extends Applet {
constructor(config) {
super(config);
process.nextTick((() => {
// set the view engine and template location
this.setViewEngine('ejs');
this.setViewPath(path.join(__dirname, 'views'));
// configure the static file directory
this.setStaticContentPath(path.join(__dirname, 'public'));
// Configure the session
this.setSession('express-session', {
secret: '95f0d5bd-b3aa-482d-8469-b6ee04776d8a',
resave: false,
saveUninitialized: true,
cookie: {
secure: true,
path: this.configuration.applet.container
}
});
var wss = new WebSocket.Server( { server: this } );
wss.on('connection', (socket, request) => {
socket.on('message', (data) => {
console.log(request.session);
console.log(data);
});
});
// Finally add the router
this.app.use('/', router);
}).bind(this));
}
}
module.exports = MyApplet;
Release 1.0.0
Initial release of the CoffeeCat server.