SharkSSL™ Embedded SSL/TLS Stack
WssProtocolHandshake Struct Reference

Detailed Description

The WssProtocolHandshake structure keeps state information for the web server function MS_ebServer.

An instance of this structure must be initialized as follows:

The WssProtocolHandshake structure keeps state information for the web server function MS_ebServer.
Definition: MSLib.h:141

#include <MSLib.h>

Data Fields

const U8 * b64Credent
 In param: Enable HTTP basic authentication by setting 'b64Credent' to a B64 encoded string of 'username:password'. More...
 
const U8 * realm
 In param: Set the HTTP basic authentication's 'realm' name.
 
MSFetchPage fetchPage
 In param: set the page fetch callback function if you plan on storing the web application in the device. More...
 
void * fetchPageHndl
 In param: The MSFetchPage handle, if any.
 
U8 * request
 Out param: Set to the initial HTTP header request line. More...
 
U8 * origin
 Out param: Set to the HTTP WebSocket header 'origin', if sent by the client.
 
U8 * hKeys [MAX_HTTP_H_SIZE]
 HTTP header keys sent by the client. More...
 
U8 * hVals [MAX_HTTP_H_SIZE]
 All HTTP header values sent by the client. More...
 

Field Documentation

◆ b64Credent

const U8* WssProtocolHandshake::b64Credent

In param: Enable HTTP basic authentication by setting 'b64Credent' to a B64 encoded string of 'username:password'.

All browsers support HTTP authentication using standard requests, but few browsers support HTTP authentication on WebSocket connection upgrades. You may therefore consider creating your own authentication on top of a newly established WebSocket connection. You can create your server side logic such that no commands are accepted until the client authenticates. Another option is to require that clients authenticate by using SSL certificates.

See also
MS_ERR_AUTHENTICATION

◆ fetchPage

MSFetchPage WssProtocolHandshake::fetchPage

In param: set the page fetch callback function if you plan on storing the web application in the device.

Example code:

wph.fetchPage = msInitZipFileSystem(&zfs, getLedZipReader());
wph.fetchPageHndl=&zfs;
MSFetchPage msInitZipFileSystem(ZipFileSystem *zfs, ZipReader *zipReader)
Initializes the ZIP File System and returns a WsFetchPage callback function.
MSFetchPage fetchPage
In param: set the page fetch callback function if you plan on storing the web application in the devi...
Definition: MSLib.h:175
void * fetchPageHndl
In param: The MSFetchPage handle, if any.
Definition: MSLib.h:178
The ZipFileSystem handle.
Definition: ZipFileSystem.h:74
See also
msInitZipFileSystem

◆ hKeys

U8* WssProtocolHandshake::hKeys[MAX_HTTP_H_SIZE]

HTTP header keys sent by the client.

NULL signals end of array.

◆ hVals

U8* WssProtocolHandshake::hVals[MAX_HTTP_H_SIZE]

All HTTP header values sent by the client.

NULL signals end of array.

◆ request

U8* WssProtocolHandshake::request

Out param: Set to the initial HTTP header request line.

Example:

GET /path/to/file/index.html HTTP/1.0