Documentation ¶
Index ¶
Constants ¶
View Source
const ( TokenHeaderName = "X-Auth-Token" UserIdHeaderName = "X-Auth-Id" )
View Source
const ( TypeOpen uint8 = 1 + iota TypeOpenSuccess TypePacket TypeMessage TypePing TypePong )
View Source
const ( SocketErrorCodeInvalidProtocol = 1 + iota SocketErrorCodeRequestAuth SocketErrorCodeNotAccessible SocketErrorCodeCloseConnection )
View Source
const (
SocketProxyNextProto = "lpsc1"
)
Variables ¶
View Source
var ( SocketErrorInvalidProtocol = NewMessageError(SocketErrorCodeInvalidProtocol, "invalid protocol") SocketErrorRequestAuth = NewMessageError(SocketErrorCodeRequestAuth, "need authenticate") SocketErrorNotAccessible = NewMessageError(SocketErrorCodeNotAccessible, "You don't have privilege") SocketErrorCloseConnection = NewMessageError(SocketErrorCodeCloseConnection, "Sorry, the server has close connection") )
View Source
var (
HeartbeatInterval = 30 * time.Second
)
View Source
var TokenExpiration = 5 * time.Minute
Functions ¶
This section is empty.
Types ¶
type AccessLog ¶
type AccessLog struct { Host string `json:"host"` Protocol string `json:"protocol"` Method string `json:"method"` Path string `json:"path"` Status int `json:"status"` UserAgent string `json:"user_agent"` ClientIp string `json:"client_ip"` AppTime int `json:"app_time_ms"` RequestId string `json:"request_id"` UserId string `json:"user_id"` }
type ErrorTokenAuthorization ¶
type ErrorTokenAuthorization struct {
Endpoint string
}
func (*ErrorTokenAuthorization) Error ¶
func (e *ErrorTokenAuthorization) Error() string
type HttpProxy ¶
func NewHttpProxy ¶
func (*HttpProxy) ServeGithubWebHook ¶
func (*HttpProxy) ServeHTTP ¶
ServeHTTP has responsibility to serving content to client. ctx should be used instead of req.Context().
func (*HttpProxy) ServeSlackWebHook ¶
type MessageError ¶
type MessageError interface { error Code() int Message() string Params() url.Values Clone() MessageError }
func NewMessageError ¶
func NewMessageError(code int, message string) MessageError
func ParseMessageError ¶
func ParseMessageError(v url.Values) (MessageError, error)
type SocketProxy ¶
func NewSocketProxy ¶
func NewSocketProxy(conf *configv2.Config, ct *connector.Server) *SocketProxy
func (*SocketProxy) Accept ¶
func (s *SocketProxy) Accept(_ *http.Server, conn tlsConn, _ http.Handler)
Accept handles incoming connection. conn is an established connection that is finished handshake.
func (*SocketProxy) Shutdown ¶
func (s *SocketProxy) Shutdown()
Click to show internal directories.
Click to hide internal directories.