remove previous SockJS implementation, and move example to WebSocket test

This commit is contained in:
Erik Krogh Kristensen
2020-03-23 23:45:05 +01:00
parent a1e032bee6
commit 7b7eddff1e
2 changed files with 0 additions and 46 deletions

View File

@@ -0,0 +1,16 @@
const express = require('express');
const http = require('http');
const sockjs = require('sockjs');
const app = express();
const server = http.createServer(app);
const sockjs_echo = sockjs.createServer({});
sockjs_echo.on('connection', function(conn) {
conn.on('data', function(message) {
var data = JSON.parse(message);
conn.write(JSON.stringify(eval(data.test)));
});
});
sockjs_echo.installHandlers(server, {prefix:'/echo'});
server.listen(9090, '127.0.0.1');