const ws = require("ws");
// const { wsconfig } = require("./ws_config");
// const { connection } = require("./connection");
const wsServer = new ws.Server({
port: 8080
// perMessageDeflate: wsconfig.perMessageDeflate
});
wsServer.on("connection", function(c){
c.send("hi")
});
global.fearless = {
wss: wsServer,
broadcast: function(msg) {
wsServer.clients.forEach(client => {
client.send(msg);
});
},
count: function() {
return wsServer.clients.size;
}
};