It derives from <GObject>.
A WebSocket extension
WebsocketExtension is the base class for WebSocket extension
objects.
parent-instanceConfigures self with the given params.
Passed: a <SoupWebsocketExtension>.
Passed: a
<SoupWebsocketConnectionType>, or
one of its symbols.
Passed, or left out: a hash table, each key a foreign pointer and each
value a foreign pointer, or #f.
the parameters
Returned: a boolean.
#t if extension could be configured with the given parameters, or
#f otherwise
Get the parameters strings to be included in the request header.
If the extension doesn’t include any parameter in the request, this
function returns #f.
Passed: a <SoupWebsocketExtension>.
Returned: a string, or #f.
a new allocated string with the parameters
Get the parameters strings to be included in the response header.
If the extension doesn’t include any parameter in the response, this
function returns #f.
Passed: a <SoupWebsocketExtension>.
Returned: a string, or #f.
a new allocated string with the parameters
Process a message after it’s received.
If the payload isn’t changed the given payload is just returned,
otherwise bytes:unref is called on the
given payload and a new <GBytes> is
returned with the new data.
Extensions using reserved bits of the header will reset them in header.
Passed: a <SoupWebsocketExtension>.
Passed: an unsigned 8-bit integer, or a character. Returned: an unsigned 8-bit integer.
the message header
Passed: a <GBytes>.
the payload data
Returned: a <GBytes>.
the message payload data, or #f in case of error
Process a message before it’s sent.
If the payload isn’t changed the given payload is just returned,
otherwise Glib.Bytes.unref is called on the given payload
and a new <GBytes> is returned with the new
data.
Extensions using reserved bits of the header will change them in header.
Passed: a <SoupWebsocketExtension>.
Passed: an unsigned 8-bit integer, or a character. Returned: an unsigned 8-bit integer.
the message header
Passed: a <GBytes>.
the payload data
Returned: a <GBytes>.
the message payload data, or #f in case of error
Configures self with the given params.
To override it in a new class, give register-type #:vfuncs
`((configure . ,procedure)). The procedure is called as
(procedure self connection-type params) ⇒ %return.
Passed: the class whose implementation to call:
<SoupWebsocketExtension>, or a class
that derives from it, or its GType number.
Passed: a <SoupWebsocketExtension>.
Passed: a
<SoupWebsocketConnectionType>, or
one of its symbols.
Passed, or left out: a hash table, each key a foreign pointer and each
value a foreign pointer, or #f.
the parameters
Returned: a boolean.
#t if extension could be configured with the given parameters, or
#f otherwise
Get the parameters strings to be included in the request header.
If the extension doesn’t include any parameter in the request, this
function returns #f.
To override it in a new class, give register-type #:vfuncs
`((get-request-params . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<SoupWebsocketExtension>, or a class
that derives from it, or its GType number.
Passed: a <SoupWebsocketExtension>.
Returned: a string, or #f.
a new allocated string with the parameters
Get the parameters strings to be included in the response header.
If the extension doesn’t include any parameter in the response, this
function returns #f.
To override it in a new class, give register-type #:vfuncs
`((get-response-params . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<SoupWebsocketExtension>, or a class
that derives from it, or its GType number.
Passed: a <SoupWebsocketExtension>.
Returned: a string, or #f.
a new allocated string with the parameters
Process a message after it’s received.
If the payload isn’t changed the given payload is just returned,
otherwise bytes:unref is called on the
given payload and a new <GBytes> is
returned with the new data.
Extensions using reserved bits of the header will reset them in header.
To override it in a new class, give register-type #:vfuncs
`((process-incoming-message . ,procedure)). The procedure is called
as (procedure self header payload) ⇒ %return header.
Passed: the class whose implementation to call:
<SoupWebsocketExtension>, or a class
that derives from it, or its GType number.
Passed: a <SoupWebsocketExtension>.
Passed: an unsigned 8-bit integer, or a character. Returned: an unsigned 8-bit integer.
the message header
Passed: a <GBytes>.
the payload data
Returned: a <GBytes>.
the message payload data, or #f in case of error
Process a message before it’s sent.
If the payload isn’t changed the given payload is just returned,
otherwise Glib.Bytes.unref is called on the given payload
and a new <GBytes> is returned with the new
data.
Extensions using reserved bits of the header will change them in header.
To override it in a new class, give register-type #:vfuncs
`((process-outgoing-message . ,procedure)). The procedure is called
as (procedure self header payload) ⇒ %return header.
Passed: the class whose implementation to call:
<SoupWebsocketExtension>, or a class
that derives from it, or its GType number.
Passed: a <SoupWebsocketExtension>.
Passed: an unsigned 8-bit integer, or a character. Returned: an unsigned 8-bit integer.
the message header
Passed: a <GBytes>.
the payload data
Returned: a <GBytes>.
the message payload data, or #f in case of error