Documentation ¶
Index ¶
Constants ¶
View Source
const ( WebsocketReadTimeout = 30 * time.Second WebsocketWriteTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPHandler ¶
type HTTPHandler struct { RedisHub RedisHub Delegate Delegate LoggerFactory *log.Factory OriginMatcher WebsocketOriginMatcher }
HTTPHandler receives incoming websocket messages and delegates them to the delegate. For each websocket connection, a redis pubsub connection is established. Every message from the redis pubsub connection is forwarded to the websocket connection verbatim.
func (*HTTPHandler) ServeHTTP ¶
func (h *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RedisHub ¶
type RedisHub interface {
Subscribe(channelName string) (chan *redis.Message, func())
}
type WebsocketOriginMatcher ¶
type WebsocketOutgoingMessage ¶
type WebsocketOutgoingMessage struct { MessageType websocket.MessageType Data []byte }
Click to show internal directories.
Click to hide internal directories.