This commit is contained in:
adman
2025-12-19 17:26:58 +01:00
parent cb38382a07
commit d7df6b25ef
20 changed files with 401 additions and 167 deletions
+23
View File
@@ -0,0 +1,23 @@
package client
import (
"net"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
)
func Connect(addr string) (ret *proto.Conn, err error) {
ret = &proto.Conn{}
ret.Version = "1.21.8"
ret.State = proto_base.Handshaking
ret.CompressionThreshold = -1
ret.Actor = proto_base.Client
ret.Conn, err = net.Dial("tcp", addr)
if err != nil {
return
}
ret.R = ret.Conn
ret.W = ret.Conn
return
}