mirror of
https://github.com/cbeuw/Cloak.git
synced 2024-11-11 13:11:03 +00:00
24 lines
742 B
Go
24 lines
742 B
Go
package server
|
|
|
|
import (
|
|
"github.com/cbeuw/Cloak/internal/util"
|
|
"net"
|
|
)
|
|
|
|
type Transport interface {
|
|
HasRecordLayer() bool
|
|
UnitReadFunc() func(net.Conn, []byte) (int, error)
|
|
}
|
|
|
|
type TLS struct{}
|
|
|
|
func (TLS) String() string { return "TLS" }
|
|
func (TLS) HasRecordLayer() bool { return true }
|
|
func (TLS) UnitReadFunc() func(net.Conn, []byte) (int, error) { return util.ReadTLS }
|
|
|
|
type WebSocket struct{}
|
|
|
|
func (WebSocket) String() string { return "WebSocket" }
|
|
func (WebSocket) HasRecordLayer() bool { return false }
|
|
func (WebSocket) UnitReadFunc() func(net.Conn, []byte) (int, error) { return util.ReadWebSocket }
|