File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616- 支持` HTTP3 ` (dev分支,用于尝鲜测试),测试可以跟cloudflare CDN通信
1717- 支持智能代理模式
1818- 支持自定义User-Agent(UA)
19- - 支持前置代理功能(目前支持的协议有http,socks5)
19+ - 支持前置代理功能(目前支持的协议有http,https, socks5)
2020
2121### 协议分析
2222- 简单的来讲就是把客户端请求的数据(头+Body),打包POST到php server,格式如下:
@@ -109,14 +109,17 @@ php-proxy.key文件,则使用内部预留的CA(也就是我自己生成的CA),
109109}
110110```
11111114 . v2.1.3版本,支持前置代理,当proxy配置为空时,不使用前置代理;这种代理只在连接到php server时使用,在智能代理模式中,直接连接是不经过前置代理的
112- 目前只支持http, socks5协议,配置格式参考如下:
112+ 目前只支持http,https, socks5协议,配置格式参考如下:
113113```
114114//http
115115http://127.0.0.1:80
116116http://koala:123456@127.0.0.1:80
117117//socks5
118118socks5://user:password@127.0.0.1:1080
119119socks5://127.0.0.1:1080
120+ //https
121+ https://127.0.0.1:80
122+ https://koala:123456@127.0.0.1:80
120123```
121124```
122125{
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ func (cli *client) init_client() {
123123 TLSClientConfig : cli .tlsconfig ,
124124 }
125125 if cli .urlproxy != nil {
126+ if cli .urlproxy .Scheme == "https" {
127+ //for connect https proxy server
128+ cli .tr .DialTLS = cli .DialTLS
129+ }
126130 cli .tr .Proxy = http .ProxyURL (cli .urlproxy )
127131 } else {
128132 cli .tr .Proxy = http .ProxyFromEnvironment
@@ -132,6 +136,7 @@ func (cli *client) init_client() {
132136 Transport : cli .tr ,
133137 }
134138}
139+
135140func (cli * client ) VerifyConnection (cs tls.ConnectionState ) error {
136141 //
137142 cert := cs .PeerCertificates [0 ]
@@ -143,6 +148,14 @@ func (cli *client) VerifyConnection(cs tls.ConnectionState) error {
143148 }
144149}
145150
151+ func (cli * client ) DialTLS (network , addr string ) (net.Conn , error ) {
152+ tlsconfig := & tls.Config {
153+ InsecureSkipVerify : cli .cfg .Insecure ,
154+ }
155+ conn , err := tls .Dial (network , addr , tlsconfig )
156+ return conn , err
157+ }
158+
146159//for HTTPS Forward PROXY dialer(need test)
147160func (cli * client ) Dial (network , addr string ) (c net.Conn , err error ) {
148161 tlsconfig := & tls.Config {
You can’t perform that action at this time.
0 commit comments