Skip to content

Commit 93c8a1f

Browse files
committed
update
1 parent 09e33a4 commit 93c8a1f

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ https://koala:123456@127.0.0.1:80
141141
所以为了安全起见,建议自己动手生成CA;当然你觉得也没啥隐私可泄露的,这也无所谓了
142142

143143
### php免费空间推荐
144-
- [000webhost](https://www.000webhost.com/)
145-
- [heroku](https://www.heroku.com/)
146-
- [Vercel](https://vercel.com/)
144+
- [000webhost](https://www.000webhost.com/)(我最早用的这个,还不错)
145+
- [heroku](https://www.heroku.com/)(这个平台,是我目前在用的最多的)
146+
- [Vercel](https://vercel.com/)(这个平台free plan的php执行时间限制在5s之内,因此下载大文件会出现FUNCTION_INVOCATION_TIMEOUT错误,解决办法只有upgrade plan;不过速度方面是最快的)
147147

148148
### TODO
149149
- 增加请求头添加的配置,也许可以用来放到国内外(免费)的php空间,做免流代理

client.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,22 @@ func (cli *client) DialTLS(network, addr string) (net.Conn, error) {
156156
return conn, err
157157
}
158158

159-
//for HTTPS Forward PROXY dialer(need test)
159+
//for HTTPS Forward PROXY dialer for feature use(need test)
160160
func (cli *client) Dial(network, addr string) (c net.Conn, err error) {
161161
tlsconfig := &tls.Config{
162162
InsecureSkipVerify: cli.cfg.Insecure,
163163
}
164-
conn, err := tls.Dial("tcp", cli.urlproxy.Hostname()+":"+cli.urlproxy.Port(), tlsconfig)
164+
var port string
165+
if cli.urlproxy.Port() == "" {
166+
if cli.urlproxy.Scheme == "http" {
167+
port = "80"
168+
} else if cli.urlproxy.Scheme == "https" {
169+
port = "443"
170+
} else {
171+
port = "80"
172+
}
173+
}
174+
conn, err := tls.Dial("tcp", cli.urlproxy.Hostname()+":"+port, tlsconfig)
165175
if err != nil {
166176
return conn, errors.New("HTTPS Proxy:" + err.Error())
167177
}

response.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ func (res *response) patch_response(r *bufio.Reader, req *http.Request) (resp *h
2929
if string(prefix[:n]) == "HTTP/2 " {
3030
// fix HTTP/2 proto
3131
resp, error = http.ReadResponse(bufio.NewReader(io.MultiReader(bytes.NewBufferString("HTTP/2.0 "), r)), req)
32+
} else if string(prefix[:n]) == "HTTP/3 " {
33+
// fix HTTP/3 proto(feature may has this issue)
34+
resp, error = http.ReadResponse(bufio.NewReader(io.MultiReader(bytes.NewBufferString("HTTP/3.0 "), r)), req)
3235
} else {
3336
// other proto
3437
resp, error = http.ReadResponse(bufio.NewReader(io.MultiReader(bytes.NewBuffer(prefix[:n]), r)), req)

0 commit comments

Comments
 (0)