Documentation ¶
Index ¶
Constants ¶
const ( RequestMethod = "X-SOCKETACE" AcceptsProtocolVersion = "Accepts-Protocol-Version" UserAgent = "User-Agent" Status = "Status" Capabilities = "Capabilities" CapabilityStartTls = "StartTLS" SecurityUnderlying = "underlying" SecurityNone = "none" SecurityTls = "tls" )
Variables ¶
var SupportedProtocolVersions = []string{ version.ProtocolVersion, }
Functions ¶
This section is empty.
Types ¶
type ClientConnection ¶
type ClientConnection struct { streams.Connection ServerVersion string // contains filtered or unexported fields }
ClientConnection represents a client to the socketace server. It announces the client to the server, checks the server and establishes the connection.
func NewClientConnection ¶
func NewClientConnection(c net.Conn, manager cert.TlsConfig, secure bool, host string) (*ClientConnection, error)
NewClientConnection will create a connection and negotiate the protocol and TLS security
func (*ClientConnection) Secure ¶
func (cc *ClientConnection) Secure() bool
Secure will return `true` is security has been enabled for this connection (either by encrypting the whole channel or by starting encryption using `StartTLS`
func (*ClientConnection) SecurityTech ¶
func (cc *ClientConnection) SecurityTech() string
func (*ClientConnection) String ¶
func (cc *ClientConnection) String() string
type Request ¶
type Request struct { Method string // e.g. "X-SOCKETACE" URL string // e.g. "/" Proto string // e.g. "HTTP/1.0" Headers textproto.MIMEHeader }
type Response ¶
type Response struct { Status string // e.g. "200 OK" StatusCode int // e.g. 200 Proto string // e.g. "HTTP/1.1" Headers textproto.MIMEHeader }
type ServerConnection ¶
type ServerConnection struct { streams.Connection ClientVersion string // contains filtered or unexported fields }
ServerConnection represents the server part of this app. It waits for the client announcement checks if versions match and disconnects it it can't establish a connection
func NewServerConnection ¶
func NewServerConnection(c net.Conn, manager cert.TlsConfig, secure bool) (*ServerConnection, error)
NewProxyWrapperServer will wait for client request and negotiate protocol version
func (*ServerConnection) Secure ¶
func (sc *ServerConnection) Secure() bool
Secure will return `true` is security has been enabled for this connection (either by encrypting the whole channel or by starting encryption using `StartTLS`
func (*ServerConnection) SecurityTech ¶
func (sc *ServerConnection) SecurityTech() string
func (*ServerConnection) String ¶
func (sc *ServerConnection) String() string