GithubHelp home page GithubHelp logo

rythem's Introduction

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

rythem's People

Contributors

bakso avatar iptton avatar kinvix avatar lizaifang avatar m0o0scar avatar qhwa avatar techblog avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.