Still need to create crypto object and use it to encrypt messages Need to create TLS still
16 lines
320 B
Go
16 lines
320 B
Go
package networking
|
|
|
|
import "net"
|
|
|
|
type Client[T any] struct {
|
|
Connection Connection[T]
|
|
}
|
|
|
|
func NewClient[T any]() Client[T] {
|
|
dialConn, err := net.Dial("tcp", "localhost:8080")
|
|
if err != nil {
|
|
panic("Could not open connection to server")
|
|
}
|
|
conn := NewConnection[T](dialConn)
|
|
return Client[T]{Connection: conn}
|
|
}
|