mirror of
https://git.sr.ht/~emerson/reflectionircd
synced 2025-04-13 09:59:52 +00:00
20 lines
No EOL
538 B
JavaScript
20 lines
No EOL
538 B
JavaScript
import { readFileSync } from 'fs';
|
|
import { createServer } from 'tls';
|
|
import { Client } from './lib/Client.js';
|
|
import { Server } from './lib/Server.js';
|
|
|
|
const config = JSON.parse(readFileSync(process.argv[2]));
|
|
const ircd = new Server(config);
|
|
|
|
const listener = createServer({
|
|
cert: readFileSync(config["certFile"]),
|
|
key: readFileSync(config["keyFile"])
|
|
});
|
|
|
|
listener.on('secureConnection', (c) => {
|
|
new Client(c, ircd);
|
|
})
|
|
|
|
listener.listen(config["port"], () => {
|
|
console.log(`Listening on port ${config["port"]}`);
|
|
}) |