const socket = io({
query: {
arr: ['a', 'b']
}
});
WSSocketIO.SocketIO.Parameters := '&arr=[''a'',''b'']';
WSSocketIO.SocketIO.Parameters := '&arr=["a","b"]';
WSSocketIO.SocketIO.Parameters := '&arr=%5B%27a%27,%27b%27%5D';
/**
* the authentication payload sent when connecting to the Namespace
*/
auth?: { [key: string]: any } | ((cb: (data: object) => void) => void);
/**
* Credentials that are sent when accessing a namespace.
*
* @example
* const socket = io({
* auth: {
* token: "abcd"
* }
* });
*
* // or with a function
* const socket = io({
* auth: (cb) => {
* cb({ token: localStorage.token })
* }
* });
*/
public auth: { [key: string]: any } | ((cb: (data: object) => void) => void);
procedure OnHTTPRequest(Sender: TObject; aRequest: TsgcWSSocketIOHTTPRequest);
begin
aRequest.Headers.Add('Authorization: Token your-token');
end;