Skip to content

Commit fb8ad37

Browse files
authored
fix: 反向代理限流失效 (#863)
https://docs.colyseus.io/zh_hk/colyseus/how-to/rate-limit/ 使用nginx限流会只识别为服务器ip,需启用trust proxy
1 parent 9023210 commit fb8ad37

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

service/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,6 @@ router.post('/verify', async (req, res) => {
8282

8383
app.use('', router)
8484
app.use('/api', router)
85+
app.set('trust proxy', 1)
8586

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

0 commit comments

Comments
 (0)