chore: use early conn to support real ws 0-rtt

This commit is contained in:
wwqgtxx
2023-02-24 09:54:54 +08:00
parent a1d008e6f0
commit 75680c5866
13 changed files with 132 additions and 40 deletions

View File

@ -7,7 +7,6 @@ import (
"io"
"net"
"sync"
"time"
"github.com/Dreamacro/clash/common/buf"
N "github.com/Dreamacro/clash/common/net"
@ -208,12 +207,12 @@ func newConn(conn net.Conn, client *Client, dst *DstAddr) (*Conn, error) {
}
}
go func() {
select {
case <-c.handshake:
case <-time.After(200 * time.Millisecond):
c.sendRequest(nil)
}
}()
//go func() {
// select {
// case <-c.handshake:
// case <-time.After(200 * time.Millisecond):
// c.sendRequest(nil)
// }
//}()
return c, nil
}