From 7481f3ef45e961cd6c724ad6c1e1bd8fb34e34c2 Mon Sep 17 00:00:00 2001 From: Rin Date: Tue, 12 Jul 2022 12:17:36 +0100 Subject: [PATCH] this is worth a shot --- src/allnet.ts | 4 +++- src/index.ts | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/allnet.ts b/src/allnet.ts index 960b1b6..30e6c23 100644 --- a/src/allnet.ts +++ b/src/allnet.ts @@ -15,7 +15,9 @@ export default class AllnetModule extends Module { type: '*/*' })); - app.use("/sys/servlet/PowerOn", async function(req, res, next) { + app.use("/sys/servlet/PowerOn", function(req, res, next) { + console.log('amauthd'); + if (req.method !== "POST") { return res.status(405).end(); } diff --git a/src/index.ts b/src/index.ts index 47fcb8f..7b4ec81 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,6 +4,7 @@ import express from 'express'; import {PrismaClient} from '@prisma/client'; import https, {globalAgent} from 'https'; +import http from 'http'; import fs from 'fs'; import bodyParser from 'body-parser'; import AllnetModule from './allnet'; @@ -62,14 +63,14 @@ new MuchaModule().register(muchaApp); let key = fs.readFileSync('./server_wangan.key'); let cert = fs.readFileSync('./server_wangan.crt'); -https.createServer({key, cert}, allnetApp).listen(PORT_ALLNET, () => { +http.createServer(allnetApp).listen(PORT_ALLNET, '0.0.0.0', 511, () => { console.log(`ALL.net server listening on port ${PORT_ALLNET}!`); }) -https.createServer({key, cert}, muchaApp).listen(PORT_MUCHA, () => { +https.createServer({key, cert}, muchaApp).listen(PORT_MUCHA, '0.0.0.0', 511, () => { console.log(`Mucha server listening on port ${PORT_MUCHA}!`); }) -https.createServer({key, cert}, app).listen(PORT_BNGI, () => { +https.createServer({key, cert}, app).listen(PORT_BNGI, '0.0.0.0', 511, () => { console.log(`Game server listening on port ${PORT_BNGI}!`); })