Giter VIP home page Giter VIP logo

goproxy's People

Contributors

ouqiang 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

goproxy's Issues

设置auth 无效

设置了auth, 在苹果手机上不输入验证一样连接。

func (e *event) Auth(ctx *goproxy.Context, rw http.ResponseWriter) {

	basic := "Basic " + base64.StdEncoding.EncodeToString([]byte("username:password"))
	ctx.Req.Header.Add("Proxy-Authorization", basic)
}

在服务器上运行TCP被重置

在本地运行完全没有问题,包括在linux子系统中运行,也正常,但是放在linux的远程服务器上运行的时候,偶尔会代理成功,但马上就页面无法加载了,抓包看TCP重置了,在服务器上打断点发现连TCP的Accept也没有触发,换了一台服务器,结果也是一模一样。不知道是为什么。

在mac和linux下均报以下错误:remote error: tls: unknown certificate

尝试过在mac和Linux下都报下面的错误,而且访问移动端百度首页时,页面展示很奇怪,并没有展示完整:
img_v2_408f46ef-b861-4e61-8cf6-c2b15c861fbg

2023/06/23 18:33:09 BeforeRequest CONNECT //m.baidu.com:443
2023/06/23 18:33:09 m.baidu.com:443 - HTTPS解密, 握手失败: remote error: tls: unknown certificate
2023/06/23 18:33:09 BeforeRequest GET https://m.baidu.com/
2023/06/23 18:33:09 BeforeResponse GET https://m.baidu.com/, content-type=text/html; charset=utf-8
2023/06/23 18:33:09 BeforeRequest CONNECT //m.baidu.com:443
2023/06/23 18:33:09 m.baidu.com:443 - HTTPS解密, 握手失败: remote error: tls: unknown certificate
2023/06/23 18:33:09 BeforeRequest CONNECT //content-autofill.googleapis.com:443
2023/06/23 18:33:09 content-autofill.googleapis.com:443 - HTTPS解密, 握手失败: remote error: tls: unknown certificate
2023/06/23 18:33:09 BeforeRequest GET https://m.baidu.com/static/index/u.png
2023/06/23 18:33:09 BeforeResponse GET https://m.baidu.com/static/index/u.png, content-type=image/png
2023/06/23 18:33:09 BeforeRequest CONNECT //m.baidu.com:443
2023/06/23 18:33:09 m.baidu.com:443 - HTTPS解密, 握手失败: remote error: tls: unknown certificate

使用自签证书,无法访问https,ERR_PROXY_CONNECTION_FAILED

func main() {

	cache := Cache{}
	pair, err := tls.LoadX509KeyPair("server.crt", "server.key")
	if err != nil {
		panic(err)
	}
	cache.Set("127.0.0.1", &pair)

	proxy := New(WithDecryptHTTPS(&cache), WithDelegate(&EventHandler{}))
	server := &http.Server{
		Addr:         ":9090",
		Handler:      proxy,
		ReadTimeout:  1 * time.Minute,
		WriteTimeout: 1 * time.Minute,
	}
	err = server.ListenAndServe()
	if err != nil {
		panic(err)
	}

}

请求商务推广合作

作者您好,我们也是一家专业做IP代理的服务商,极速HTTP,我们注册认证会送10000IP(可以帮助您的学者适当薅羊毛试用 :) 。想跟您谈谈是否能够达成商业推广上的合作。如果您,有意愿的话,可以联系我,微信:13982004324 谢谢(如果没有意愿的话,抱歉,打扰了)

https解密失败

HTTPS解密, 请求错误: proxyconnect tcp: dial tcp :0: connect: can't assign ted address

本地已信任并安装该证书。

是否支持https代理

因为软件不支持设置代理所以要使用Proxifier将软件转发到指定代理,但是这个软件只能设置socks5https代理,但是server.ListenAndServeTLS()好像没办法支持, 开启https后将chrome设置--proxy-server=https://127.0.0.1:8080访问网站会提示ERR_PROXY_CONNECTION_FAILED或者ERR_HTTP2_PROTOCOL_ERROR

想问下怎么解密https响应包?

proxy := goproxy.New(goproxy.WithDecryptHTTPS(&Cache{}))
ctx.Req = tlsReq
fmt.Println(ctx.Req)
body, err := ioutil.ReadAll(ctx.Req.Body)
fmt.Println(string(body),err)
ctx.Req.Body = ioutil.NopCloser(bytes.NewReader(body))
这个能获取https明文请求包了。

但https的响应包怎么获取?

body, err := ioutil.ReadAll(resp.Body)
fmt.Println(string(body),err)
resp.Body = ioutil.NopCloser(bytes.NewReader(body))
err = resp.Write(tlsClientConn)
获取到的响应包是密文的

http: superfluous response

When I set response body in function Connect, I got this when I run it:

http: superfluous response.WriteHeader call from github.com/ouqiang/goproxy.(*Proxy).httpProxy.func1 (proxy.go:340)

The code I set the response body:

func (e *EventHandler) Connect(ctx *goproxy.Context, rw http.ResponseWriter) {
	if ctx.Req.Host == "test.com" {
			rw.Header().Set("Content-Type", "text/html; charset=utf-8")
			_, _ = rw.Write([]byte("<!doctype html><html><head><title>Hello, World!</title></head><body><h1 style='text-align:center;'>Hello, World!</h1></body></html>"))
	}
}

是否支持websocket?

比如客户端请求ws://192.168.0.10/test,这是代理,然后代理请求wss://23.233.14.17/test

23.233.14.17 这个ip写死在代理里面

二级代理请求IP代理超时

启动二级代理后,程序将请求发送过来,在二级代理中连接IP的时候,会显示timeout,我们程序开的是40并发,1分钟有5-10次的timeout的问题。请问你们有遇到过吗?

中间人代理模式访问受cloudflare保护的网站时报1020禁止

  1. 测试非中间人模式正常。
  2. 测试whisle(另一个代理软件)中间人代理正常。
  3. 发现cloudflare保护的网站中请求头包含签名信息,推测会对请求头或者raw请求签名。所以请求过程中的header顺序、大小写、空白字符等不一致均有可能导致。希望能解决或者指点。

非常感谢

苹果设备https 失败。

苹果设备https 失败,已安装证书并信任,
PC端 curl 提示“curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - 吊销功能无法检查证书是否吊销。”

app使用代理日志: HTTPS解密, 握手失败: remote error: tls: unknown certificate

上传文件失败

通过安装证书,打开站点都正常,上传文件会失败。
multipart/form-data 的文件上传。

尝试中间人代理, 解密HTTPS,Chrome没问题 火狐失败,求解

尝试中间人代理, 解密HTTPS,火狐失败,Chrome没问题

关键代码:
goproxy.New(goproxy.WithDecryptHTTPS(&Cache{}), goproxy.WithDelegate(&EventHandler{})
程序提示:
ERR www.baidu.com:443 - HTTPS解密, 握手失败: remote error: tls: bad certificate

Win10 ,85.0 (64 位) Firefox提示
连接到 www.baidu.com 时发生错误。您正试图导入一个与已存在证书相同颁发者和序列号但却不相同的证书。

错误代码:SEC_ERROR_REUSED_ISSUER_AND_SERIAL

由于不能验证所收到的数据是否可信,无法显示您想要查看的页面。
建议向此网站的管理员反馈这个问题。

PS:

  1. 火狐“security.enterprise_roots.enabled”并把值设置为true
  2. 根证书已导入

谢谢

发现https报错

我使用的是中间人代理,也就是你写的goproxy案例源码运行,结果遇到报错情况,我使用的是谷歌浏览器,访问的是12306.cn网址, 结果12306.cn访问正常,但是有以下报错信息,这是为什么,我猜测是证书问题吧,因为提示的信息是https解密失败,报错信息如下:
2020/08/18 03:47:53 https://clients2.googleusercontent.com/crx/blobs/QgAAAC6zw0qH2DJtnXe8Z7rUJP29CWJ9zeWEcj3GGPrivl5tRubHNgYOBQPoXgda7uGVr60dRxJXFGZEMk8k1Z-T_DzUV57zZqwo0SnuHBZ3mW5
SAMZSmuUXlXeR0eto3WFshPzEgLgRTnTIKQ/extension_6_38_2_0.crx - HTTPS解密, 请求错误: dial tcp 172.217.24.1:443: i/o timeout

Cannot support non-SNI enabled clients

Cannot support non-SNI enabled clients

2020/07/14 03:34:33 Cannot support non-SNI enabled clients
2020/07/14 03:34:33 Error accepting new connection - read tcp x.x.x.x:443-

x.x.x.x:11586: wsarecv: An existing connection was forcibly closed by the
remote host.

能收费解决下吗

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.