A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/novnc/websockify-js/wiki/websock.js below:

websock.js · novnc/websockify-js Wiki · GitHub

The websock.js module is the client library for interacting with websockify. It has transparent support for binary data and has automatic fallback to the web-socket-js Flash Websocket shim/polyfill if the browser does not support WebSockets natively.

The Websock API is similar to the standard WebSocket object but there are some differences:

The methods and callbacks supported by WebSock are:

Methods
name		parameters		description
on		(evt, handler)		Add a callback handler for event name evt
open		(uri)			Connect to the WebSockets server at uri
close		()			Disconnect from the WebSockets server
get_sQ		()			Returns a direct reference to the send queue
get_rQ		()			Returns a direct reference to the receive queue
get_rQi		()			Returns the receive queue index
set_rQi		()			Set the receive queue index
rQlen		()			Return the number of unread bytes on the receive queue
rQpeek8		()			Return the first byte of the receive queue without moving the index
rQshift8	()			Shift off and return a byte from the receive queue
rQunshift8	(num)			Unshift a byte onto the head of the receive queue
rQshift16	()			Shift off and return a 16-bit word byte from the receive queue
rQshift32	()			Shift off and return a 32-bit word byte from the receive queue
rQshiftStr	(len)			Shift off and return len bytes converted to a String from the receive queue
rQshiftBytes	(len)			Shift off and return len bytes as an Array of bytes from the receive queue
rQslice		(start, end)		Return an Array of bytes from start to end relative to the receive queue index
rQwait		(msg, num, goback)	If receive queue has num bytes left return false, otherwise return false
flush		()			Try sending any pending data from the send queue
send		(array)			Add an array of bytes to the send queue and try to flush
send_string	(str)			Add a string (decode to bytes) to the send queue and try to flush

Callbacks
name		parameters		description
open		()			A connection was established to the WebSockets server
message		()			A message has been received, decoded and added to the receive queue
close		(event)			The connection has closed with event
error		(event)			An error has occurred with event

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4