initial commit
This commit is contained in:
11
client/client.go
Normal file
11
client/client.go
Normal file
@ -0,0 +1,11 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/go-gost/gost/client/connector"
|
||||
"github.com/go-gost/gost/client/transporter"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
Connector connector.Connector
|
||||
Transporter transporter.Transporter
|
||||
}
|
11
client/connector/connector.go
Normal file
11
client/connector/connector.go
Normal file
@ -0,0 +1,11 @@
|
||||
package connector
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
)
|
||||
|
||||
// Connector is responsible for connecting to the destination address.
|
||||
type Connector interface {
|
||||
Connect(ctx context.Context, conn net.Conn, network, address string) (net.Conn, error)
|
||||
}
|
14
client/transporter/transporter.go
Normal file
14
client/transporter/transporter.go
Normal file
@ -0,0 +1,14 @@
|
||||
package transporter
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
)
|
||||
|
||||
// Transporter is responsible for handshaking with server.
|
||||
type Transporter interface {
|
||||
Dial(ctx context.Context, addr string) (net.Conn, error)
|
||||
Handshake(ctx context.Context, conn net.Conn) (net.Conn, error)
|
||||
// Indicate that the Transporter supports multiplex
|
||||
Multiplex() bool
|
||||
}
|
Reference in New Issue
Block a user