Skip to content

Commit

Permalink
fix: 反向代理限流失效 (Chanzhaoyu#863)
Browse files Browse the repository at this point in the history
https://docs.colyseus.io/zh_hk/colyseus/how-to/rate-limit/

使用nginx限流会只识别为服务器ip,需启用trust proxy
  • Loading branch information
gitgitgogogo authored and jingChen55 committed Mar 27, 2023
1 parent be290c3 commit ff0daca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions service/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ router.post('/verify', async (req, res) => {

app.use('', router)
app.use('/api', router)
app.set('trust proxy', 1)

app.listen(3002, () => globalThis.console.log('Server is running on port 3002'))

0 comments on commit ff0daca

Please sign in to comment.