Skip to content

Commit 0c555eb

Browse files
Ilya VinokurovIlya Vinokurov
Ilya Vinokurov
authored and
Ilya Vinokurov
committed
fix
1 parent 5a1249d commit 0c555eb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tunnel_client/tcp_client.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package tunnel_client
22

33
import (
44
"bytes"
5+
"crypto/tls"
56
"encoding/json"
67
"fmt"
78
"io"
@@ -30,7 +31,12 @@ func NewTunnelClient(opts TunnelClientOptions) *TunnelClient {
3031
func (tc *TunnelClient) Connect() {
3132
for {
3233
log.Println("Attempting to connect to server...")
33-
conn, err := net.Dial("tcp", tc.URL)
34+
tlsConfig := &tls.Config{
35+
InsecureSkipVerify: true, // Note: In production, you should verify certificates
36+
}
37+
38+
// Connect with TLS
39+
conn, err := tls.Dial("tcp", tc.URL, tlsConfig)
3440
if err != nil {
3541
log.Printf("Failed to connect: %v. Retrying in 3 seconds...", err)
3642
time.Sleep(3 * time.Second)

0 commit comments

Comments
 (0)