Skip to content

Commit

Permalink
feat: unobscure proxy ip
Browse files Browse the repository at this point in the history
  • Loading branch information
rayriffy committed Nov 24, 2023
1 parent 40b032c commit f1578f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ const app = new Elysia()
rateLimit({
duration: 60 * 60 * 1000, // 1 hour
max: 500, // 500 req per hour
generator: (req, server) => {
return (
req.headers.get('CF-Connecting-IP') ??
server?.requestIP(req)?.address ??
''
)
},
})
)
.use(
Expand Down

0 comments on commit f1578f3

Please sign in to comment.