Commit ·
de10cbd
1
Parent(s): d201beb
update
Browse files
ndcc/server/lib/index.js
CHANGED
|
@@ -134,6 +134,13 @@ exports.plugin = {
|
|
| 134 |
server.route({
|
| 135 |
method: 'GET',
|
| 136 |
path: '/test',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
handler: async (request, h) => {
|
| 138 |
try {
|
| 139 |
return 'test23231222123132232323221321'
|
|
|
|
| 134 |
server.route({
|
| 135 |
method: 'GET',
|
| 136 |
path: '/test',
|
| 137 |
+
options:{
|
| 138 |
+
plugins:{
|
| 139 |
+
'hapi-rate-limit': {
|
| 140 |
+
enabled: false
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
},
|
| 144 |
handler: async (request, h) => {
|
| 145 |
try {
|
| 146 |
return 'test23231222123132232323221321'
|
ndcc/server/plugins/rateLimit.js
CHANGED
|
@@ -37,6 +37,7 @@ exports.plugin = {
|
|
| 37 |
plugin:require('hapi-rate-limit'),
|
| 38 |
options: {
|
| 39 |
enabled:true,
|
|
|
|
| 40 |
pathLimit:false, //每个周期在给定路径上可以发出的请求总数
|
| 41 |
userPathLimit:false, //每个用户每个时间段在给定路径上可以发出的请求总数
|
| 42 |
userLimit:Number(requestsPerSecond.split('/')[0]), //用户每个时间段可以发出的总请求数
|
|
|
|
| 37 |
plugin:require('hapi-rate-limit'),
|
| 38 |
options: {
|
| 39 |
enabled:true,
|
| 40 |
+
trustProxy:true,
|
| 41 |
pathLimit:false, //每个周期在给定路径上可以发出的请求总数
|
| 42 |
userPathLimit:false, //每个用户每个时间段在给定路径上可以发出的请求总数
|
| 43 |
userLimit:Number(requestsPerSecond.split('/')[0]), //用户每个时间段可以发出的总请求数
|