Giter Site home page Giter Site logo

gomitmproxy's Introduction

gomitmproxy

gomitmproxy是想用golang语言实现的mitmproxy,主要实现http代理,目前实现了http代理和https抓包功能,差距甚远,加油。

可以用来干嘛?

  • http代理
  • http和https抓包
  • 科学上网

将来要实现的功能

  • 修改http(s)请求
  • 重复请求
  • 同时监听多端口
  • 支持socks5、websocket等协议
  • 界面支持终端和网页两种形式

安装使用

    git clone https://github.com/sheepbao/gomitmproxy.git
    cd gomitmproxy 
    ./build.sh 

例子

  • http代理
gomitmproxy 

不带任何参数,表示http代理,默认端口8080,更改端口用 -port

  • http抓包
gomitmproxy -m 

fetch http

加 -m 参数,表示抓取http请求和响应

  • http代理科学上网

    首先你得有个墙外的服务器,如阿里香港的服务器,为图中的Server,假设其ip地址为:22.222.222.222

在Server执行:
    gomitmproxy -port 8888
在你自己电脑执行:
    gomitmproxy -port 8080 -raddr 22.222.222.222:8888

然后浏览器设置代理,ip为localhost,端口为8080,即可实现科学上网

proxy

最后

欢迎star和fork,一起学习交流。

License

The 3-clause BSD License

  • see LICENSE for more details

gomitmproxy's People

Contributors

boyazheng avatar zboya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gomitmproxy's Issues

"listome.com/log" 未包含

"listome.com/log"

go build
genKey.go:17:2: cannot find package "listome.com/log" in any of:
C:\Go\src\listome.com\log (from $GOROOT)
D:\Project\go\src\listome.com\log (from $GOPATH)

不能build

这个包对于http隧道是怎么处理的呢?

例如用这个包开一个http代理。
那么curl用这个代理去请求一个https网址的之后,会发送一个HTTP CONNECT请求和源站建立透明隧道。
这个包能劫持这种情况吗?

是否能实现请求计数功能

我在尝试使用gomitmproxy的Forward功能,将请求代理至下一级代理,我想在转发的时候做一个计数统计,看一段时间内转发了多少请求。
我发现使用了io.Copy(dst, src)之后,所有请求在两个connection之间直接拷贝转发,根本拦截不到到底发送了多少个请求。有办法可以满足我的技术需求吗?谢谢

请问无法抓https吗?

server.go:3012: http: TLS handshake error from 10.0.0.10:53828: tls: first record does not look like a TLS handshake

测试了几次,无法抓到https包。
加-tls和不加都抓不到

不知道为什么,我用时总有这样的issues.但也可以用,只是速度不与直接上网快

[gomitmproxy]2016/06/21 13:51:40 /root/gocode/src/github.com/gomitmproxy/gomitmproxy.go:116: readRequest err: EOF
[gomitmproxy]2016/06/21 13:51:40 /root/gocode/src/github.com/gomitmproxy/gomitmproxy.go:116: readRequest err: EOF
[gomitmproxy]2016/06/21 13:51:40 /root/gocode/src/github.com/gomitmproxy/gomitmproxy.go:116: readRequest err: EOF
[gomitmproxy]2016/06/21 13:51:40 /root/gocode/src/github.com/gomitmproxy/gomitmproxy.go:116: readRequest err: EOF
[gomitmproxy]2016/06/21 13:51:40 /root/gocode/src/github.com/gomitmproxy/gomitmproxy.go:116: readRequest err: EOF
[gomitmproxy]2016/06/21 13:51:40 /root/gocode/src/github.com/gomitmproxy/gomitmproxy.go:116: readRequest err: EOF
[gomitmproxy]2016/06/21 13:51:40 /root/gocode/src/github.com/gomitmproxy/gomitmproxy.go:116: readRequest err: EOF
[gomitmproxy]2016/06/21 13:51:40 /root/gocode/src/github.com/gomitmproxy/gomitmproxy.go:116: readRequest err: EOF

https代理报handshake失败

证书已经安装在手机了
2016/08/23 15:31:52 http: TLS handshake error from 172.20.35.218:64908: tls: oversized record received with length 20037
2016/08/23 15:31:52 http: TLS handshake error from 172.20.35.218:64910: tls: first record does not look like a TLS handshake
QQ:513994881,谢谢

获取网站服务器地址

dump.go添加:fmt.Printf("%s %s\n", Blue("RemoteAddr:"), req.RemoteAddr)
获取的ip不对的,如果本机是代理,ip获取出来是127.0.0.1,你试试。。
Request:
GET http://www.baidu.com/ <--200
RemoteAddr: 127.0.0.1:51647
User-Agent: [curl/7.43.0]
Accept: [/]
Connection: [Keep-Alive]
Response:
Server: [BWS/1.1]
Content-Type: [text/html; charset=utf-8]
Connection: [Keep-Alive]
Vary: [Accept-Encoding]

connection problem

我安装了gomitmproxy,没有任何命令行参数.
2016/07/11 16:09:43 proxy listening port:8080
2016/07/11 16:09:43 ListenAndServe
2016/07/11 16:13:30 http: TLS handshake error from 10.1.1.129:56117: EOF

用手机通过这个代理上网。手机上会出现Connection Problem
this page contains too many server redirects.

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.