2021-09-16 07:26:57 -07:00
|
|
|
import '../imports/api/';
|
|
|
|
|
import './google-oauth.js';
|
2022-03-09 07:55:26 -08:00
|
|
|
|
|
|
|
|
import url from 'url';
|
|
|
|
|
//import './google-oauth.js';
|
2021-09-16 07:26:57 -07:00
|
|
|
import connectRoute from 'connect-route';
|
|
|
|
|
|
2022-03-09 07:55:26 -08:00
|
|
|
/* Did not work at all.. not sure why.
|
|
|
|
|
let WebSocketServer = require("ws").Server;
|
|
|
|
|
//var wss = new WebSocketServer({ port: env.PORT });
|
|
|
|
|
let wss = new WebSocketServer({host: '192.168.3.101', port: 3001});
|
|
|
|
|
|
|
|
|
|
console.log("Starting WS");
|
|
|
|
|
|
|
|
|
|
wss.on("connection", function (ws) {
|
|
|
|
|
console.log("WS Open");
|
|
|
|
|
|
|
|
|
|
ws.on("message", function(data) {
|
|
|
|
|
console.log(data);
|
|
|
|
|
ws.send("Pong");
|
|
|
|
|
}).on("error", (err) => {
|
|
|
|
|
console.log(err);
|
|
|
|
|
})
|
|
|
|
|
}).on('error', (err) => {
|
|
|
|
|
console.error(err);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// const net = require('net');
|
|
|
|
|
//
|
|
|
|
|
// const server = net.createServer((socket) => {
|
|
|
|
|
// socket.on('data', (data) => {
|
|
|
|
|
// console.log(data.toString());
|
|
|
|
|
// socket.write("Pong");
|
|
|
|
|
// });
|
|
|
|
|
// }).on('error', (err) => {
|
|
|
|
|
// console.error(err);
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
*/
|