Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

客户端需要前置代理要怎么配置? #35

Open
newcastlecy opened this issue Nov 17, 2017 · 15 comments
Open

客户端需要前置代理要怎么配置? #35

newcastlecy opened this issue Nov 17, 2017 · 15 comments

Comments

@newcastlecy
Copy link

newcastlecy commented Nov 17, 2017

goflyway -k="password" -up="VPS:PORT" -l=":LOCAL_PORT"

前置代理 要配置代理ip 10.10.81.12 端口5366 才能上网

goflyway这个支持么?

@coyove
Copy link
Owner

coyove commented Nov 17, 2017

10.10.81.12:5366 是什么类型的代理,认证方式是什么

@newcastlecy
Copy link
Author

HTTP代理

@coyove
Copy link
Owner

coyove commented Nov 17, 2017

现在release和master都没有前置代理功能,需要切换gdev分支下

如果是纯HTTP代理(应该不太可能吧),需要mitm模式,导入根证书ca.pem后命令:

./goflyway -up="[email protected]:5366;VPS:PORT" -k=...

如果是https代理,命令:

./goflyway -up="10.10.81.12:5366@VPS:PORT" -k=...

@newcastlecy
Copy link
Author

应该是squid 做成的Http代理,可以编译个win的包么

@coyove
Copy link
Owner

coyove commented Nov 20, 2017

请使用https://github.com/coyove/goflyway/releases/tag/v1.0.11a 版本进行测试

@newcastlecy
Copy link
Author

newcastlecy commented Nov 22, 2017

goflyway -k="password" -up="[email protected]:5366;VPS:PORT" -l=":8100"
goflyway (build 1711200915366)

@coyove
Copy link
Owner

coyove commented Nov 22, 2017

错误显示10.10.81.12:5366不可连接

@newcastlecy
Copy link
Author

10.10.81.12:5366 应该是 纯HTTP代理,直接代理访问国内是没有问题的

@coyove
Copy link
Owner

coyove commented Nov 22, 2017

直接将浏览器的代理设为10.10.81.12:5366可以访问?

@newcastlecy
Copy link
Author

可以

@coyove
Copy link
Owner

coyove commented Nov 22, 2017

如果有curl的话,请尝试

curl -v -X GET -H "Host: www.baidu.com" http://10.10.81.12:5366
curl -v -X GET -x 10.10.81.12:5366 http://www.baidu.com

看看有什么输出

@newcastlecy
Copy link
Author

root@localhost# curl -v -X GET -x 10.10.81.12:5366 http://www.baidu.com
Note: Unnecessary use of -X or --request, GET is already inferred.

  • Rebuilt URL to: http://www.baidu.com/
  • Trying 10.10.81.12...
  • Connected to 10.10.81.12 (10.10.81.12) port 5366 (#0)

GET http://www.baidu.com/ HTTP/1.1
Host: www.baidu.com
User-Agent: curl/7.47.0
Accept: /
Proxy-Connection: Keep-Alive

< HTTP/1.1 200 OK
< Server: bfe/1.0.8.18
< Date: Wed, 22 Nov 2017 06:14:27 GMT
< Content-Type: text/html
< Content-Length: 2381
< Last-Modified: Mon, 23 Jan 2017 13:28:11 GMT
< Connection: Keep-Alive
< ETag: "588604eb-94d"
< Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
< Pragma: no-cache
< Set-Cookie: BDORZ=27315; max-age=86400; domain=.baidu.com; path=/
< Accept-Ranges: bytes
<

<title>百度一下,你就知道</title>
新闻 hao123 地图 视频 贴吧 登录 <script>document.write('登录');</script> 更多产品

关于百度 About Baidu

©2017 Baidu 使用百度前必读  意见反馈 京ICP证030173号 

  • Connection #0 to host 10.10.81.12 left intact

@coyove
Copy link
Owner

coyove commented Nov 22, 2017

该问题无法重现

提议:
在服务器上git clone https://github.com/inaz2/proxy2这个简单的代理脚本,把proxy2.py里的第375行改为server_address = ('::', port),然后使用python proxy2.py启动

客户端使用-up="mitm@VPS:8080;VPS:PORT"连接,看看是否可以正常工作

@jzp820927
Copy link

想请教一下,纯HTTP代理 为什么要 需要mitm模式?

@coyove
Copy link
Owner

coyove commented Dec 16, 2017

浏览器发出的https请求走不了http代理,必须通过中间人把其中的数据拆出来。
同理websocket,http2因为要求全双工的连接,所以goflyway也并不支持

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants