libwebsockets
Lightweight C library for HTML5 websockets
Vhost mounts and options
+ Collaboration diagram for Vhost mounts and options:

Data Structures

struct  lws_protocol_vhost_options
 
struct  lws_http_mount
 

Macros

#define AUTH_MODE_MASK   0xF0000000
 

Enumerations

enum  lws_mount_protocols {
  LWSMPRO_HTTP = 0 , LWSMPRO_HTTPS = 1 , LWSMPRO_FILE = 2 , LWSMPRO_CGI = 3 ,
  LWSMPRO_REDIR_HTTP = 4 , LWSMPRO_REDIR_HTTPS = 5 , LWSMPRO_CALLBACK = 6
}
 
enum  lws_authentication_mode { LWSAUTHM_DEFAULT = 0 , LWSAUTHM_BASIC_AUTH_CALLBACK = 1 << 28 }
 

Detailed Description

Vhost mounts and options


Data Structure Documentation

◆ lws_protocol_vhost_options

struct lws_protocol_vhost_options

struct lws_protocol_vhost_options - linked list of per-vhost protocol name=value options

This provides a general way to attach a linked-list of name=value pairs, which can also have an optional child link-list using the options member.

Definition at line 1263 of file lws-context-vhost.h.

+ Collaboration diagram for lws_protocol_vhost_options:
Data Fields
const struct lws_protocol_vhost_options * next

linked list

const struct lws_protocol_vhost_options * options

child linked-list of more options for this node

const char * name

name of name=value pair

const char * value

value of name=value pair

◆ lws_http_mount

struct lws_http_mount

struct lws_http_mount

arguments for mounting something in a vhost's url namespace

Definition at line 1300 of file lws-context-vhost.h.

+ Collaboration diagram for lws_http_mount:
Data Fields
const struct lws_http_mount * mount_next

pointer to next struct lws_http_mount

const char * mountpoint

mountpoint in http pathspace, eg, "/"

const char * origin

path to be mounted, eg, "/var/www/warmcat.com"

const char * def

default target, eg, "index.html"

const char * protocol

"protocol-name" to handle mount

const struct lws_protocol_vhost_options * cgienv

optional linked-list of cgi options. These are created as environment variables for the cgi process

const struct lws_protocol_vhost_options * extra_mimetypes

optional linked-list of mimetype mappings

const struct lws_protocol_vhost_options * interpret

optional linked-list of files to be interpreted

int cgi_timeout

seconds cgi is allowed to live, if cgi://mount type

int cache_max_age

max-age for reuse of client cache of files, seconds

unsigned int auth_mask

bits set here must be set for authorized client session

unsigned int cache_reusable:1

set if client cache may reuse this

unsigned int cache_revalidate:1

set if client cache should revalidate on use

unsigned int cache_intermediaries:1

set if intermediaries are allowed to cache

unsigned int cache_no:1

set if client should check cache always

unsigned char origin_protocol

one of enum lws_mount_protocols

unsigned char mountpoint_len

length of mountpoint string

const char * basic_auth_login_file

NULL, or filepath to use to check basic auth logins against. (requires LWSAUTHM_DEFAULT)

Macro Definition Documentation

◆ AUTH_MODE_MASK

#define AUTH_MODE_MASK   0xF0000000

#include <include/libwebsockets/lws-context-vhost.h>

The authentication mode is stored in the top 4 bits of lws_http_mount.auth_mask

Definition at line 1294 of file lws-context-vhost.h.

Enumeration Type Documentation

◆ lws_mount_protocols

#include <include/libwebsockets/lws-context-vhost.h>

enum lws_mount_protocols This specifies the mount protocol for a mountpoint, whether it is to be served from a filesystem, or it is a cgi etc.

Enumerator
LWSMPRO_HTTP 

http reverse proxy

LWSMPRO_HTTPS 

https reverse proxy

LWSMPRO_FILE 

serve from filesystem directory

LWSMPRO_CGI 

pass to CGI to handle

LWSMPRO_REDIR_HTTP 

redirect to http:// url

LWSMPRO_REDIR_HTTPS 

redirect to https:// url

LWSMPRO_CALLBACK 

hand by named protocol's callback

Definition at line 1274 of file lws-context-vhost.h.

1274  {
1275  LWSMPRO_HTTP = 0,
1276  LWSMPRO_HTTPS = 1,
1277  LWSMPRO_FILE = 2,
1278  LWSMPRO_CGI = 3,
1279  LWSMPRO_REDIR_HTTP = 4,
1280  LWSMPRO_REDIR_HTTPS = 5,
1281  LWSMPRO_CALLBACK = 6,
1282 };
@ LWSMPRO_CGI
@ LWSMPRO_HTTP
@ LWSMPRO_FILE
@ LWSMPRO_REDIR_HTTPS
@ LWSMPRO_CALLBACK
@ LWSMPRO_REDIR_HTTP
@ LWSMPRO_HTTPS

◆ lws_authentication_mode

#include <include/libwebsockets/lws-context-vhost.h>

enum lws_authentication_mode This specifies the authentication mode of the mount. The basic_auth_login_file mount parameter is ignored unless LWSAUTHM_DEFAULT is set.

Enumerator
LWSAUTHM_DEFAULT 

default authenticate only if basic_auth_login_file is provided

LWSAUTHM_BASIC_AUTH_CALLBACK 

Basic auth with a custom verifier

Definition at line 1288 of file lws-context-vhost.h.

1288  {
1289  LWSAUTHM_DEFAULT = 0,
1290  LWSAUTHM_BASIC_AUTH_CALLBACK = 1 << 28
1291 };
@ LWSAUTHM_BASIC_AUTH_CALLBACK
@ LWSAUTHM_DEFAULT