### Custom Replay Example Source: https://reqable.com/zh-CN/docs/capture/repeat An example illustrating custom replay settings for a request, including delay and interval. ```text 小明在13:00:00这个时间点设定了重发https://www.test.com/get请求, 重发次数3次,延时3000ms,间隔10000ms。那么, 第一次请求发送的时间点为13:00:03,延时3s; 第二次请求发送的时间点为13:00:13,延时13s; 第三次请求发送的时间点为13:00:23,延时23s。 ``` -------------------------------- ### SSL Proxy Rule Example Source: https://reqable.com/zh-CN/docs/capture/ssl This example demonstrates how to configure a wildcard rule for SSL proxying. It shows how a rule like '*.apple.com' can match various subdomains. ```plaintext https://www.apple.com/ https://api.apple.com/ ``` -------------------------------- ### Redirect Rule Example Source: https://reqable.com/zh-CN/docs/capture/rewrite This example demonstrates how to set up a rewrite rule to redirect a specific URL to a new URL, preserving query parameters and path segments. ```plaintext https://hello.com/foo/bar/ok?abc=123 https://world.com/new/* https://world.com/new/foo/bar/ok?abc=123 ``` -------------------------------- ### Example Request ID Source: https://reqable.com/zh-CN/docs/rest/request_id An example of a generated Request ID with a specific UUID. ```text req-id-aee9bdc1-ad01-11ed-ace8-ade55d424a3d ``` -------------------------------- ### 在 Linux 上使用 apt 安装 Reqable Source: https://reqable.com/zh-CN/docs/getting-started 在 Linux 系统上,可以使用 apt 包管理器安装 Reqable。请确保已安装 GTK 库和 x64 架构。 ```bash sudo apt install reqable-app-linux-x86_64.deb ``` -------------------------------- ### 将localhost映射到自定义别名 Source: https://reqable.com/zh-CN/docs/capture/localhost 在Mac和Linux系统上,使用镜像功能将localhost映射到自定义别名(例如'go'),以便捕获localhost流量。配置完成后,可以使用别名代替localhost来访问本地服务。 ```text 原始链接:http://localhost:3000/ 新的链接:http://go:3000/ ``` -------------------------------- ### Modify Request Query Parameter (Exact Value) Source: https://reqable.com/zh-CN/docs/capture/rewrite Modifies a specific query parameter's value. This example changes the 'key' parameter to '54321'. ```plaintext https://reqable.com?key=12345&foo=bar&hello=world key=54321 ``` -------------------------------- ### Context Object Example Source: https://reqable.com/zh-CN/docs/capture/addons Demonstrates how to access and modify various properties of the Context object within onRequest and onResponse functions. Includes accessing URL, scheme, host, port, connection info, app info, environment variables, and shared data. Also shows how to set highlight properties. ```python def onRequest(context, request): # 打印url,例如:https://reqable.com/ print(context.url) # 打印schema,例如:https print(context.scheme) # 打印host,例如:reqable.com print(context.host) # 打印port,例如:443 print(context.port) # 打印TCP连接ID,例如:1 print(context.cid) # 打印TCP连接开始时间,例如:1686711219444 print(context.ctime) # 打印HTTP的会话ID,例如:1 print(context.sid) # 打印HTTP的会话开始时间,例如:1686711224132 print(context.stime) # 获取环境变量 print(context.env['foo']) print(context.env['$timestamp']) # 写入环境变量(优先写入当前激活的自定义环境,没有激活环境则写入全局环境) context.env['foo'] = 'bar' # 设置请求红色高亮 context.highlight = Highlight.red # 设置共享参数 context.shared = 'Hello' # Done return request def onResponse(context, response): # 打印共享参数,输出:Hello print(context.shared) return response ``` -------------------------------- ### Modify Request Query Parameter (Regex with Group) Source: https://reqable.com/zh-CN/docs/capture/rewrite Applies a prefix to the original value of a query parameter using regex capture groups. This example adds 'api-' to the original value of 'key'. ```plaintext key=(.*) key=api-$1 ``` -------------------------------- ### Form-data Request Body Example Source: https://reqable.com/zh-CN/docs/rest/body Form-data supports various parts including single-line text, multi-line text, and files. Reqable automatically handles the `Content-Type: multipart/form-data` and `Content-Length` headers, and generates the Boundary. ```text --boundary Content-Disposition: form-data; name="field1" value1 --boundary Content-Disposition: form-data; name="file"; filename="example.txt" Content-Type: text/plain file content --boundary-- ``` -------------------------------- ### Reqable日志文件目录 Source: https://reqable.com/zh-CN/docs/faq/linux 此路径是Reqable在Linux系统上存储日志文件的默认位置。当遇到问题需要排查时,可以到此目录下查找相关的日志文件。 ```bash ~/.local/share/reqable/log ``` -------------------------------- ### Modify Request Query Parameter (Regex Value) Source: https://reqable.com/zh-CN/docs/capture/rewrite Uses a regular expression to modify a query parameter's value, even if the original value is unknown. This example changes any value for 'key' to '54321'. ```plaintext key=.* key=54321 ```