lineProps
Enable features such as proxyHost, proxyTunnel, and safeHtml through rules.
📌 Differences from enable:
enableis a global configuration.
linePropsonly applies to the rule on the line where the configuration is located.
Rule Syntax
pattern operation lineProps://action1|action2|... [filters...]
# Equivalent to:
pattern operation lineProps://action1 lineProps://action2 ... [filters...]
linePropscannot be used as anoperationalone and only applies to theoperationon the same line.
| Parameters | Description | Detailed Documentation |
|---|---|---|
| pattern | Expression to match the request URL | Match Pattern Documentation |
| operation | Operation Instructions | Operation Instruction Documentation |
| action | Specific actions, see the description below | |
| filters | Optional filters, supporting matching: • Request URL/Method/Header/Content • Response Status Code/Header | Filter Documentation |
important:!importantof type css attribute, increasing rule prioritysafeHtml: This is a security protection mechanism. When injecting content into an HTML page usinghtmlXxx/jsXxx/cssXxx, the first non-whitespace character in the response is checked to see if it is a{or a[(the opening character of a JSON object). Injection is performed only if it is not. This effectively prevents accidental injection of non-standard HTML responses (such as JSON endpoints).strictHtml: This is a security protection mechanism. When injecting content into an HTML page usinghtmlXxx/jsXxx/cssXxx, the first non-whitespace character in the response is checked to see if it is a<. Injection is performed only if it is not. This effectively prevents accidental injection of non-standard HTML responses (such as JSON endpoints).disableAutoCors: Disables automatic addition of necessary CORS (Cross-Origin Resource Sharing) headers for file protocol substitution requests.disableUserLogin: Disables displaying the login dialog when setting statusCode://401.enableUserLogin: Enables displaying the login dialog when setting statusCode://401. (Shown by default, disablesdisable.userLogin).internal: Appliesproxy,socks, andhostprotocol drop rules to Whistle internal requests.internalOnly: Appliesproxy,socks, andhostprotocol drop rules to Whistle internal requests only.internalProxy: Uses proxy protocols likeproxyandsocksto forward requests to another proxy server (such as another Whistle proxy server). When this feature is enabled, HTTPS requests decrypted by the first-tier proxy will be transmitted in plaintext throughout the proxy chain, allowing upstream proxies to directly access the plaintext data.proxyFirst: give priority to the proxy rule (by default, bothhostandproxyare matched, and onlyhosttakes effect)proxyHost: Both the proxy and host rules take effect.proxyHostOnly: Functions similarly toproxyHost, but if no host matches, the proxy rule will be automatically disabled.proxyTunnel: Used withproxyHost, it allows the upstream proxy to tunnel to the upstream HTTP proxy. See the example below for details.weakRule: By default, theweakRulerule will be disabled when protocols such asfile](./file) are configured. By setting theweakRuleproperty, you can increase the priority of theproxy` (./proxy) rule, ensuring it still works in the above scenario.
Configuration Example
Without lineProps://important
www.example.com/path file:///User/xxx/important1.html
www.example.com/path file:///User/xxx/important2.htmlAccessing https://www.example.com/path will match file:///User/xxx/important1.html
Using lineProps://important
www.example.com/path file:///User/xxx/important1.html
www.example.com/path file:///User/xxx/important2.html lineProps://importantAccessing https://www.example.com/path will match file:///User/xxx/important2.html
Inject text
www.example.com/path file://(test) resType://html
www.example.com/path htmlPrepend://(alert(1))
www.example.com/path jsPrepend://(alert(1))
www.example.com/path cssPrepend://(alert(1))Visit https://www.example.com/path and return the response content:
<!DOCTYPE html>
<style>alert(1)</style>
alert(1)
<script>alert(1)</script>testUse enable://strictHtml
www.example.com/path file://(test) resType://html
www.example.com/path htmlPrepend://(alert(1))
www.example.com/path jsPrepend://(alert(1)) enable://strictHtml
www.example.com/path cssPrepend://(alert(1))Visit https://www.example.com/path and return the response content:
test
enable://strictHtmlis effective for all rules
Use lineProps://strictHtml
www.example.com/path file://(test) resType://html
www.example.com/path htmlPrepend://(alert(1))
www.example.com/path jsPrepend://(alert(1)) lineProps://strictHtml
www.example.com/path cssPrepend://(alert(1))Visit https://www.example.com/path Return response content:
<!DOCTYPE html>
<style>alert(1)</style>
alert(1)test
lineProps://strictHtmlonly applies to the line where the rule is located