a fiddler-like project using Qt
C++ C JavaScript Objective-C TypeScript CSS Other
Permalink
Failed to load latest commit information.
Contents/Resources added waterfall page for network requests Feb 20, 2012
RythemManagerUI 过滤改为全url过滤 Feb 21, 2014
RythemTimes check rule's availability before matching & replacing Feb 23, 2012
liveload merge iptton Mar 27, 2013
proxy 目录级别替换,本地无文件的条目以绿色标记 Mar 16, 2014
quazip 增加多语言支持 May 23, 2012
rule 1.改变配置文件存放目录,以免更新时旧配置丢失 Feb 22, 2014
static add icons May 15, 2012
widget go back to Qt 4.8… Nov 14, 2013
zlib Merge branch 'master' of https://github.com/iptton/Rythem Apr 13, 2012
.gitignore merge iptton Mar 27, 2013
Rythem-icon.ico add icon May 15, 2012
Rythem-icon.png add icon May 15, 2012
Rythem.asta now you can match rules with rule manager, replacement is also coming… Feb 6, 2012
Rythem.png update graphic Feb 13, 2012
Rythem.pro 过滤改为全url过滤 Feb 21, 2014
Rythem.xmind update progress Feb 13, 2012
Rythem2.icns add icons May 15, 2012
codeGenerator.html add a code generator Feb 8, 2012
composer.cpp 增加多语言支持 May 23, 2012
composer.h go back to Qt 4.8… Nov 14, 2013
composer.ui 增加多语言支持 May 23, 2012
deploy update scripts Mar 27, 2013
deploy.bat remove auto start on launch(windows) Aug 28, 2012
family.png http server with content-type(including manifest type) Jan 13, 2012
graphics.graffle for http/1.1 Jan 10, 2012
httpfiles.qrc pac config for mac... Sep 18, 2012
logo.rc add icon May 15, 2012
main.cpp 1.改变配置文件存放目录,以免更新时旧配置丢失 Feb 22, 2014
mainwindow.cpp 1.改变配置文件存放目录,以免更新时旧配置丢失 Feb 22, 2014
mainwindow.h 过滤改为全url过滤 Feb 21, 2014
mainwindow.ui 1. 增加host过滤功能 Feb 20, 2014
pipe state.png add pipe state graphic Jan 10, 2012
proxysetting.c 修复几处编译警告 Apr 11, 2013
publish update scripts Mar 27, 2013
qnetworkproxyfactoryexendforpac.cpp add files.move proxyserver to single class. add class deal with PAC Dec 27, 2011
qnetworkproxyfactoryexendforpac.h 删除不必要的文件/websocket相关的保留文件,但不再放到项目配置里 Apr 1, 2012
qt_zh_CN.qm add Qt framework translate zh_CN file and one build step for move qm … May 29, 2012
readme.md update license Jan 2, 2014
remove.png ui May 16, 2012
ryconnectiontableview.cpp ui May 16, 2012
ryconnectiontableview.h go back to Qt 4.8… Nov 14, 2013
rymimedata.h drag session to composer Apr 13, 2012
rytablemodel.cpp 目录级别替换,本地无文件的条目以绿色标记 Mar 16, 2014
rytablemodel.h 过滤改为全url过滤 Feb 21, 2014
rytablesortfilterproxymodel.cpp 过滤改为全url过滤 Feb 21, 2014
rytablesortfilterproxymodel.h 过滤改为全url过滤 Feb 21, 2014
rythem.pac add MacOS package script & fix pac file error Sep 14, 2012
rythem_pac pac config for mac... Sep 18, 2012
rythem_zh_CN.qm 1. 修改一处错别字 Dec 11, 2013
rythem_zh_CN.ts 1.改变配置文件存放目录,以免更新时旧配置丢失 Feb 22, 2014
ryupdatechecker.cpp merge iptton Mar 27, 2013
ryupdatechecker.h 1. 增加host过滤功能 Feb 20, 2014
setupproxy use pac to config mac proxy Sep 14, 2012
singleapplication.cpp add single application solution May 29, 2012
singleapplication.h add single application solution May 29, 2012
updater add updater(including download) script for mac Sep 13, 2012
waterfallwindow.cpp fix bug in waterfall May 16, 2012
waterfallwindow.h 调整代码结构,增加logo Apr 1, 2012
waterfallwindow.ui waterfall diagram almost done Feb 21, 2012

readme.md

Rythem

fiddler like cross-platforms(MacOS/win/linux) tool using Qt

By AlloyTeam

License

MIT

使用介绍:rythem介绍-alloyteam

代码阅读建议:https://github.com/AlloyTeam/Rythem/wiki

MacOS 10.9 不支持 Qt5 . 重新回到4.8 怀抱.. 向Qt5迁移中... 代码在Qt4.7.4 & Qt4.8上运行通过,低于4.7的版本有可能会出问题

MAC下开发需增加Build Steps

command deploy.txt
working directory: %{buildDir}
Command arguments: %{sourceDir} %{buildDir}

功能

  • http代理服务

  • https tunnel透传(https抓包需求似乎不是很大,暂不实现)

  • 规则替换

      匹配模式包括`wildcard`类型及全匹配两种
      以替换后内容区分有本地及远程两种。
      本地替换有三种:目录式,单个文件式,多文件合并成一文件
      远程替换暂时只支持一个文件对应一个远程路径
      
  • host设置

  • 替换规则远程及本地导入。

  • 替换规则增删改。

  • 颜色标记已被替换的请求

  • 导入/导出 每条请求(兼容fiddler *.saz文件)

  • 批量导出response body(可用于保存整站)

  • 过滤显示请求

TODOs

  • 规则管理(远程规则的更新机制)
  • 各OS/浏览器版本下稳定性测试

主要代码结构

  • RyProxyServer: 代理server
  • RyConnection: 每个socket对应一个实例,掌管每个请求的client socket及remote socket并处理相应的请求
  • RyPipeData: 保存各个http请求的信息(包括request及response)
  • rule::RyRuleManager: 做规则替换相关

以上几个类的关系:

  1. ,当 RyProxyServer 检测到有新的client socket时,生成一个RyConnection实例,并将相应socket id传入。
  2. RyConnection 对此 client socket传入数据分析,解包成若干http请求
     2.1. 每解析到一个http包生成一个`RyPipeData`实例,并压入缓冲队列pipeList 
     2.2. 生成pipeData后,如果当前有未完成的pipeData,结束,否则跳到2.3
     2.3 通过`RyRuleManger`检测是否有当前相应的替换规则
         如有匹配规则,跳到2.3
         如无匹配规则,跳到2.4
     2.3 如获取规则则照获修改`RyPipeData`,如修改后的pipeData已有内容(内容替换类规则)
          跳到2.5,否则跳到2.4
     2.4 向远程socket写入当前pipeData的http request 数据并监听返回
          当远程返回数据解包完成,跳到2.5
     2.5 获取下一个队列中的pipeData,如果为空,结束,否则跳到2.2步
     
  3. RyConnection解析到新的请求包时,或解析到返回包时,发出相应的signal给具体UI