GithubHelp home page GithubHelp logo

mproxy's Issues

接收和发送字节不匹配的问题

最近研究了一下代码,发现如果把send 和recv 得到的buffer 长度和字母打印出来,得到的长度是一样的,但实际buffer里的数据长度却不一样。实际收到的字节比发出的字节要多一些。很奇怪啊,为什么会这样?加密不是每个字节一一对应的吗?这样解密是才能得到正确的数据。但是又能正常工作。好奇怪的现象。

recv len = 502
buffer recv = GET http://www.google.com/ HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/5.0 (Android 7.1.1; Mobile; rv:53.0) Gecko/53.0 Firefox/53.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Cookie: NID=104=m5-no8IetRfnkhU2ccoy3wv-3pnG1ZdBMETkAchadvIN0NLskY4lsZzGdVMTDK7LpSdXzXA1Z3I_5LBEcL-rsrbcr3E8opwieGQp19hdRFg0qR13CwocB1dP5aIc8W_3
Connection: keep-alive
Upgrade-Insecure-Requests: 1

send len = 502
buffer send = ���r:&&"h}}%%%|5==5>7|1=?}r����}c|c_X�=!&hr%%%|5==5>7|1=?_X!7 �57<&hr�=(;>>3}g|brz�<6 =;6re|c|cir�=0;>7ir $hga|b{r�719=}ga|br�; 74=}ga|b_X�117"&hr&7&}:&?>3"">;13&;=<}:&?>y?>3"">;13&;=<}*?>i#ob|kx}xi#ob|j_X�117"&�3<5'357hr(:��(:i#ob|j7<�i#ob|g7<i#ob|a_X�117"&�<1=6;<5hr5(;"~r674>3&7_X�==9;7hr���ocbfo?g<=j&

rfc要求代理从absolute uri中提取host,而不是从host 头部字段中提取

因为历史兼容性的原因,根据http1.0/1.1规范,代理必须从absolute uri中提取host,而不是从host head field中提取。

https://tools.ietf.org/html/rfc2616#section-5.1.2
The absoluteURI form is REQUIRED when the request is being made to a proxy.
...
Note that the proxy MAY forward the request on to another proxy or directly to the server specified by the absoluteURI.

section-5.2

1. If Request-URI is an absoluteURI, the host is part of the
Request-URI. Any Host header field value in the request MUST be
ignored.

最近GFW更新算法,mproxy是不是不能用了?

最近GFW更新算法,mproxy是不是不能用了?? 今天早上到公司,突然就不能用了,
下面 agent端的错误,server端没有日志输出。。。:
Sep 13 2017 15:12:55 Cannot connect to host [clients1.google.com:443]
Sep 13 2017 15:12:55 receive CONNECT request
Sep 13 2017 15:12:55 Host:www.google.com port: 443 io_flag:2
Sep 13 2017 15:12:55 ======= forward request to remote host:www.google.com port:443 =======
Sep 13 2017 15:12:55 receive CONNECT request
Sep 13 2017 15:12:55 Host:s2.googleusercontent.com port: 443 io_flag:2
Sep 13 2017 15:12:55 ======= forward request to remote host:s2.googleusercontent.com port:443 =======
Sep 13 2017 15:12:55 receive CONNECT request
Sep 13 2017 15:12:55 Host:s2.googleusercontent.com port: 443 io_flag:2
Sep 13 2017 15:12:55 receive CONNECT request
Sep 13 2017 15:12:55 Host:s2.googleusercontent.com port: 443 io_flag:2
Sep 13 2017 15:12:55 receive CONNECT request
Sep 13 2017 15:12:55 Host:s2.googleusercontent.com port: 443 io_flag:2
Sep 13 2017 15:12:55 receive CONNECT request
Sep 13 2017 15:12:55 Host:s2.googleusercontent.com port: 443 io_flag:2
Sep 13 2017 15:12:55 ======= forward request to remote host:s2.googleusercontent.com port:443 =======
Sep 13 2017 15:12:55 ======= forward request to remote host:s2.googleusercontent.com port:443 =======
Sep 13 2017 15:12:55 ======= forward request to remote host:s2.googleusercontent.com port:443 =======
Sep 13 2017 15:12:55 ======= forward request to remote host:s2.googleusercontent.com port:443 =======
Sep 13 2017 15:12:55 receive CONNECT request
Sep 13 2017 15:12:55 Host:www.google.com port: 443 io_flag:2
Sep 13 2017 15:12:55 ======= forward request to remote host:www.google.com port:443 =======
Sep 13 2017 15:12:55 receive CONNECT request
Sep 13 2017 15:12:55 Host:clients1.google.com port: 443 io_flag:2
Sep 13 2017 15:12:55 ======= forward request to remote host:clients1.google.com port:443 =======
Sep 13 2017 15:12:55 receive CONNECT request
Sep 13 2017 15:12:55 Host:clients1.google.com port: 443 io_flag:2
Sep 13 2017 15:12:55 ======= forward request to remote host:clients1.google.com port:443 =======
Sep 13 2017 15:12:55 Cannot connect to host [clients1.google.com:443]
Sep 13 2017 15:12:55 Cannot connect to host [clients1.google.com:443]
Sep 13 2017 15:12:55 Read Http header failed

padavan路由器运行mproxy

路由器 ./mproxy -l 8000 -d 模式运行
手机端直接填入代理IP和端口,路由器可以收到信息,但是一直报错
`Jun 21 2016 16:18:38 ============ handle new client ============
Jun 21 2016 16:18:38 >>>Header:CONNECT acs.m.taobao.com:443 HTTP/1.1
Host: acs.m.taobao.com:443
Proxy-Connection: Keep-Alive
User-Agent: Dalvik/2.1.0 (Linux; U; Android 10; MI 8 MIUI/V12.0.3.0.QEACNXM)

Jun 21 2016 16:18:38 receive CONNECT request
Jun 21 2016 16:18:38 Host:acs.m.taobao.com port: 443 io_flag:0
Jun 21 2016 16:18:38 ====== Bad remote request,close it! ====
`
不知道是哪里出问题了

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.