mirror of https://github.com/cbeuw/Cloak
remove tls on websocket
Enabling TLS on WebSocket will conflict with fake TLS parsing.
This commit is contained in:
parent
57f0c3d20a
commit
d5e6fea0b7
|
|
@ -9,8 +9,6 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
utls "github.com/refraction-networking/utls"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type WSOverTLS struct {
|
type WSOverTLS struct {
|
||||||
|
|
@ -21,16 +19,7 @@ func (WSOverTLS) HasRecordLayer() bool { return fal
|
||||||
func (WSOverTLS) UnitReadFunc() func(net.Conn, []byte) (int, error) { return util.ReadWebSocket }
|
func (WSOverTLS) UnitReadFunc() func(net.Conn, []byte) (int, error) { return util.ReadWebSocket }
|
||||||
|
|
||||||
func (WSOverTLS) PrepareConnection(sta *State, conn net.Conn) (preparedConn net.Conn, sessionKey []byte, err error) {
|
func (WSOverTLS) PrepareConnection(sta *State, conn net.Conn) (preparedConn net.Conn, sessionKey []byte, err error) {
|
||||||
utlsConfig := &utls.Config{
|
preparedConn = conn
|
||||||
ServerName: sta.ServerName,
|
|
||||||
InsecureSkipVerify: true,
|
|
||||||
}
|
|
||||||
uconn := utls.UClient(conn, utlsConfig, utls.HelloChrome_Auto)
|
|
||||||
err = uconn.Handshake()
|
|
||||||
preparedConn = uconn
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
u, err := url.Parse("ws://" + sta.RemoteHost + ":" + sta.RemotePort) //TODO IPv6
|
u, err := url.Parse("ws://" + sta.RemoteHost + ":" + sta.RemotePort) //TODO IPv6
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue