1.25 <SoupWebsocketExtension>

Class: <SoupWebsocketExtension>

It derives from <GObject>.

A WebSocket extension

WebsocketExtension is the base class for WebSocket extension objects.

Fields

parent-instance

Procedures

Method: websocket-extension:configure? self connection-type [params] ⇒ %return
Method: configure? self connection-type [params] ⇒ %return

Configures self with the given params.

self

Passed: a <SoupWebsocketExtension>.

a <SoupWebsocketExtension>

connection-type

Passed: a <SoupWebsocketConnectionType>, or one of its symbols.

either client or server

params

Passed, or left out: a hash table, each key a foreign pointer and each value a foreign pointer, or #f.

the parameters

%return

Returned: a boolean.

#t if extension could be configured with the given parameters, or #f otherwise

Method: websocket-extension:get-request-params self ⇒ %return
Method: get-request-params self ⇒ %return

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.

self

Passed: a <SoupWebsocketExtension>.

a <SoupWebsocketExtension>

%return

Returned: a string, or #f.

a new allocated string with the parameters

Method: websocket-extension:get-response-params self ⇒ %return
Method: get-response-params self ⇒ %return

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.

self

Passed: a <SoupWebsocketExtension>.

a <SoupWebsocketExtension>

%return

Returned: a string, or #f.

a new allocated string with the parameters

Method: websocket-extension:process-incoming-message self header payload ⇒ %return header
Method: process-incoming-message self header payload ⇒ %return header

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.

self

Passed: a <SoupWebsocketExtension>.

a <SoupWebsocketExtension>

header

Passed: an unsigned 8-bit integer, or a character. Returned: an unsigned 8-bit integer.

the message header

payload

Passed: a <GBytes>.

the payload data

%return

Returned: a <GBytes>.

the message payload data, or #f in case of error

Method: websocket-extension:process-outgoing-message self header payload ⇒ %return header
Method: process-outgoing-message self header payload ⇒ %return header

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.

self

Passed: a <SoupWebsocketExtension>.

a <SoupWebsocketExtension>

header

Passed: an unsigned 8-bit integer, or a character. Returned: an unsigned 8-bit integer.

the message header

payload

Passed: a <GBytes>.

the payload data

%return

Returned: a <GBytes>.

the message payload data, or #f in case of error

Virtual methods

Virtual method: websocket-extension:do-configure implementor self connection-type [params] ⇒ %return

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.

implementor

Passed: the class whose implementation to call: <SoupWebsocketExtension>, or a class that derives from it, or its GType number.

self

Passed: a <SoupWebsocketExtension>.

a <SoupWebsocketExtension>

connection-type

Passed: a <SoupWebsocketConnectionType>, or one of its symbols.

either client or server

params

Passed, or left out: a hash table, each key a foreign pointer and each value a foreign pointer, or #f.

the parameters

%return

Returned: a boolean.

#t if extension could be configured with the given parameters, or #f otherwise

Virtual method: websocket-extension:do-get-request-params implementor self ⇒ %return

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.

implementor

Passed: the class whose implementation to call: <SoupWebsocketExtension>, or a class that derives from it, or its GType number.

self

Passed: a <SoupWebsocketExtension>.

a <SoupWebsocketExtension>

%return

Returned: a string, or #f.

a new allocated string with the parameters

Virtual method: websocket-extension:do-get-response-params implementor self ⇒ %return

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.

implementor

Passed: the class whose implementation to call: <SoupWebsocketExtension>, or a class that derives from it, or its GType number.

self

Passed: a <SoupWebsocketExtension>.

a <SoupWebsocketExtension>

%return

Returned: a string, or #f.

a new allocated string with the parameters

Virtual method: websocket-extension:do-process-incoming-message implementor self header payload ⇒ %return header

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.

implementor

Passed: the class whose implementation to call: <SoupWebsocketExtension>, or a class that derives from it, or its GType number.

self

Passed: a <SoupWebsocketExtension>.

a <SoupWebsocketExtension>

header

Passed: an unsigned 8-bit integer, or a character. Returned: an unsigned 8-bit integer.

the message header

payload

Passed: a <GBytes>.

the payload data

%return

Returned: a <GBytes>.

the message payload data, or #f in case of error

Virtual method: websocket-extension:do-process-outgoing-message implementor self header payload ⇒ %return header

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.

implementor

Passed: the class whose implementation to call: <SoupWebsocketExtension>, or a class that derives from it, or its GType number.

self

Passed: a <SoupWebsocketExtension>.

a <SoupWebsocketExtension>

header

Passed: an unsigned 8-bit integer, or a character. Returned: an unsigned 8-bit integer.

the message header

payload

Passed: a <GBytes>.

the payload data

%return

Returned: a <GBytes>.

the message payload data, or #f in case of error