class Discord::WebSocket
- Discord::WebSocket
- Reference
- Object
Overview
Internal wrapper around HTTP::WebSocket to decode the Discord-specific payload format used in the gateway and VWS.
Defined in:
discordcr/websocket.crConstant Summary
-
Log =
Discord::Log.for("ws")
-
ZLIB_SUFFIX =
Bytes[0, 0, 255, 255]
Constructors
Instance Method Summary
- #close(code : HTTP::WebSocket::CloseCode | Int | Nil = nil, message = nil)
- #on_close(&handler : HTTP::WebSocket::CloseCode, String -> )
- #on_compressed(&handler : Packet -> )
- #on_compressed_stream(&handler : Packet -> )
- #on_message(&handler : Packet -> )
- #run
- #send(message)
Constructor Detail
def self.new(host : String, path : String, port : Int32, tls : Bool, zlib_buffer_size : Int32 = (10 * 1024) * 1024)
#