Expand handleInitialRequest documentation #335

This commit is contained in:
Rob Wu
2021-03-17 21:12:42 +01:00
parent 9f1af82434
commit 4c18680552

View File

@@ -97,7 +97,8 @@ proxy requests. The following options are supported:
Example: `['https://good.example.com', 'http://good.example.com']`
* function `handleInitialRequest` - If set, it is called with the request, response and a parsed
URL of the requested destination (null if unavailable). If the function returns true, the request
will not be handled further. It is the responsibility of the function to handle the request.
will not be handled further. Then the function is responsible for handling the request.
This feature can be used to passively monitor requests, for example for logging (return false).
* function `checkRateLimit` - If set, it is called with the origin (string) of the request. If this
function returns a non-empty string, the request is rejected and the string is send to the client.
* boolean `redirectSameOrigin` - If true, requests to URLs from the same origin will not be proxied but redirected.