Files
geedge-jira/md/OMPUB-740.md

75 lines
2.7 KiB
Markdown
Raw Normal View History

2025-09-14 21:52:36 +00:00
# 特定内容推送插件开发
| ID | Creation Date | Assignee | Status |
|----|----------------|----------|--------|
| OMPUB-740 | 2022-12-07T11:13:49.000+0800 | 冯伟浩 | 完成 |
---
对于命中代理策略条件的HTTP(S)流量调用LUA插件插件向当前数据发起方例如命中数据包方向为C2S,则插件向C端推送内容推送用户预定义的html文件用户提供html文件文件中包含http header和http body并对应答内容中特定字符串进行替换具体替换规则如下
* TTTIIIMMMLUA脚本获取当前服务器时间以HTTP协议date格式替换
* LLLEEENNNLUA脚本获取当前应答内容长度以HTTP协议content_length格式替换
* UUURRRIIILUA脚本按照算法计算随机字符串。每次流量命中后实时计算替换
!screenshot-1.png|thumbnail!
* UUURRRLLL用户配置的下载服务器地址LUA脚本直接替换即可
用户如何在LUA插件中进行配置目前暂定将以上两类配置信息直接填充到LUA脚本中具体格式研发可以提出统一要求。
**liuyang** commented on *2022-12-07T11:17:34.846+0800*:
关于随机字符串简单说明:
* 8位随机字符串8个数字例如12345678
* 源IP主机序
* 数字加:加法求和
* 转换字符串从右向左取8位比如0123456789则取23456789八个字符
* Pri-key固定字符串直接拼接
* Md5:md5sum()计算
---
**gitlab** commented on *2022-12-19T14:43:25.552+0800*:
[冯伟浩|https://git.mesalab.cn/fengweihao] mentioned this issue in [a commit|https://git.mesalab.cn/tango/tfe/-/commit/34be0889e15a77ab157f0f4f888f691e06062424] of [TSG Appliance / tfe|https://git.mesalab.cn/tango/tfe] on branch [feature-OMPUB-740|https://git.mesalab.cn/tango/tfe/-/tree/feature-OMPUB-740]:{quote}OMPUB-740 Lua插件支持获取五元组和重写HTTP头信息{quote}
---
**liuyang** commented on *2022-12-21T17:29:24.730+0800*:
随机字符串联调说明:
联调服务器ip43.156.12.49登陆方式root/z!PQ&p$X@Mux
构造GET请求 http://ip/随机串/test.html
能够成功获取test.html表示随机字符串校验通过。
若无法获取文件,则可登陆服务器查看错误日志:/var/www随机串校验脚本和error.log在/var/www/html
---
2025-09-14 22:26:17 +00:00
# Attachments
2025-09-14 21:52:36 +00:00
2025-09-14 22:26:17 +00:00
Attachment: http_resp_filter_by_lua.lua
2025-09-14 22:27:11 +00:00
2025-09-14 22:26:17 +00:00
[http_resp_filter_by_lua.lua](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/66375/http_resp_filter_by_lua.lua)
2025-09-14 21:52:36 +00:00
2025-09-14 22:26:17 +00:00
Attachment: screenshot-1.png
2025-09-14 22:27:11 +00:00
2025-09-14 22:26:17 +00:00
![screenshot-1.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/33455/screenshot-1.png)
Attachment: screenshot-2.png
2025-09-14 22:27:11 +00:00
2025-09-14 22:26:17 +00:00
![screenshot-2.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/33865/screenshot-2.png)
2025-09-14 21:52:36 +00:00