forked from Hri7566/mpp-server-dev2
Add debug messages
This commit is contained in:
parent
7d83cbd485
commit
c7784642a7
|
@ -37,11 +37,14 @@ export const app = Bun.serve<{ ip: string }>({
|
|||
fetch: (req, server) => {
|
||||
const reqip = server.requestIP(req);
|
||||
if (!reqip) return;
|
||||
logger.debug("x-forwarded-for:", req.headers.get("x-forwarded-for"));
|
||||
logger.debug("requestIP:", reqip);
|
||||
const ip = req.headers.get("x-forwarded-for") || reqip.address;
|
||||
|
||||
if (
|
||||
server.upgrade(req, {
|
||||
data: {
|
||||
ip: req.headers.get("x-forwarded-for") || reqip.address
|
||||
ip
|
||||
}
|
||||
})
|
||||
) {
|
||||
|
|
Loading…
Reference in New Issue