utls
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
package shadow
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"github.com/refraction-networking/utls"
|
||||
"io"
|
||||
"net"
|
||||
"time"
|
||||
@ -48,13 +48,13 @@ func handlerClient(conn net.Conn, serverAddress string, fakeAddressSNI string) {
|
||||
if HandshakePassword != "" {
|
||||
config.Rand = RandReaderObj
|
||||
}
|
||||
dial, err := tls.DialWithDialer(&net.Dialer{
|
||||
Timeout: time.Second * 5,
|
||||
}, "tcp", serverAddress, config)
|
||||
|
||||
rawConn, err := net.DialTimeout("tcp", serverAddress, time.Second*5)
|
||||
if err != nil {
|
||||
fmt.Printf("[Client] Dial server error: %v\n", err)
|
||||
return
|
||||
}
|
||||
dial := tls.UClient(rawConn, config, tls.HelloChrome_102)
|
||||
err = dial.Handshake()
|
||||
if err != nil {
|
||||
fmt.Printf("[Client] Handshake error: %v\n", err)
|
||||
|
Reference in New Issue
Block a user