libwebsockets/doc/html/group__context-and-vhost.html
2017-01-17 07:01:02 +08:00

742 lines
55 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libwebsockets: Context-and-vhost</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="libwebsockets.org-logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libwebsockets
</div>
<div id="projectbrief">Lightweight C library for HTML5 websockets</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__context-and-vhost.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#groups">Modules</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Context-and-vhost</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group__vhost-mounts"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vhost-mounts.html">Vhost mounts and options</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlws__protocol__vhost__options.html">lws_protocol_vhost_options</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga256a49a07d2dd5062d6cf7bdc3668096"><td class="memItemLeft" align="right" valign="top"><a id="ga256a49a07d2dd5062d6cf7bdc3668096"></a>
typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><b>lws_reload_func</b>) (void)</td></tr>
<tr class="separator:ga256a49a07d2dd5062d6cf7bdc3668096"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga41c2d763f78cc248df3b9f8645dbd2a5"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga41c2d763f78cc248df3b9f8645dbd2a5">lws_context_options</a> { <br />
&#160;&#160;<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092">LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT</a>,
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c">LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME</a> = (1 &lt;&lt; 2),
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d">LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT</a>,
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6">LWS_SERVER_OPTION_LIBEV</a> = (1 &lt;&lt; 4),
<br />
&#160;&#160;<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9">LWS_SERVER_OPTION_DISABLE_IPV6</a> = (1 &lt;&lt; 5),
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93">LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS</a> = (1 &lt;&lt; 6),
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc">LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED</a> = (1 &lt;&lt; 7),
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f">LWS_SERVER_OPTION_VALIDATE_UTF8</a> = (1 &lt;&lt; 8),
<br />
&#160;&#160;<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c">LWS_SERVER_OPTION_SSL_ECDH</a>,
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e">LWS_SERVER_OPTION_LIBUV</a> = (1 &lt;&lt; 10),
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada">LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS</a>,
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a">LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT</a> = (1 &lt;&lt; 12),
<br />
&#160;&#160;<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e">LWS_SERVER_OPTION_EXPLICIT_VHOSTS</a> = (1 &lt;&lt; 13),
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941">LWS_SERVER_OPTION_UNIX_SOCK</a> = (1 &lt;&lt; 14),
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016">LWS_SERVER_OPTION_STS</a> = (1 &lt;&lt; 15),
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8">LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY</a> = (1 &lt;&lt; 16),
<br />
&#160;&#160;<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160">LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE</a> = (1 &lt;&lt; 17),
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a87a824b2e812f4c3e7f2c4a1ea4f8abd">LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN</a> = (1 &lt;&lt; 18)
<br />
}</td></tr>
<tr class="separator:ga41c2d763f78cc248df3b9f8645dbd2a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaf2fff58562caab7510c41eeac85a8648"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN struct lws_context *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#gaf2fff58562caab7510c41eeac85a8648">lws_create_context</a> (struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *info)</td></tr>
<tr class="separator:gaf2fff58562caab7510c41eeac85a8648"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8ee0314028755f1ddfa9428e09b4fddb"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga8ee0314028755f1ddfa9428e09b4fddb">lws_context_destroy</a> (struct lws_context *context)</td></tr>
<tr class="separator:ga8ee0314028755f1ddfa9428e09b4fddb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa327c9d543edaddf06765d2c6131065c"><td class="memItemLeft" align="right" valign="top"><a id="gaa327c9d543edaddf06765d2c6131065c"></a>
LWS_VISIBLE LWS_EXTERN void&#160;</td><td class="memItemRight" valign="bottom"><b>lws_context_destroy2</b> (struct lws_context *context)</td></tr>
<tr class="separator:gaa327c9d543edaddf06765d2c6131065c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1863f0a15ab9da0f07be7bd66230d232"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga1863f0a15ab9da0f07be7bd66230d232">lws_context_deprecate</a> (struct lws_context *context, lws_reload_func cb)</td></tr>
<tr class="separator:ga1863f0a15ab9da0f07be7bd66230d232"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf023d1898a5f773288568f55b82d19e8"><td class="memItemLeft" align="right" valign="top"><a id="gaf023d1898a5f773288568f55b82d19e8"></a>
LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><b>lws_context_is_deprecated</b> (struct lws_context *context)</td></tr>
<tr class="separator:gaf023d1898a5f773288568f55b82d19e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7e9d5405547a457d86e0b4f0ae2bb1c4"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga7e9d5405547a457d86e0b4f0ae2bb1c4">lws_set_proxy</a> (struct lws_vhost *vhost, const char *proxy)</td></tr>
<tr class="separator:ga7e9d5405547a457d86e0b4f0ae2bb1c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0c54c667ccd9b8b3dddcd123ca72f87c"><td class="memItemLeft" align="right" valign="top">LWS_EXTERN LWS_VISIBLE struct lws_vhost *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga0c54c667ccd9b8b3dddcd123ca72f87c">lws_create_vhost</a> (struct lws_context *context, struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *info)</td></tr>
<tr class="separator:ga0c54c667ccd9b8b3dddcd123ca72f87c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga98d88c9080fd89c37114363a6474ea73"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga98d88c9080fd89c37114363a6474ea73">lwsws_get_config_globals</a> (struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *info, const char *d, char **config_strings, int *len)</td></tr>
<tr class="separator:ga98d88c9080fd89c37114363a6474ea73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga341064721add2618ae1b29717493a212"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga341064721add2618ae1b29717493a212">lwsws_get_config_vhosts</a> (struct lws_context *context, struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *info, const char *d, char **config_strings, int *len)</td></tr>
<tr class="separator:ga341064721add2618ae1b29717493a212"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8db03e19a372e34ac25cf21af894a02c"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN struct lws_vhost *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga8db03e19a372e34ac25cf21af894a02c">lws_vhost_get</a> (struct lws *wsi) LWS_WARN_DEPRECATED</td></tr>
<tr class="separator:ga8db03e19a372e34ac25cf21af894a02c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga06e77ce2916f8bc9826ef8d9d68e3932"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN struct lws_vhost *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga06e77ce2916f8bc9826ef8d9d68e3932">lws_get_vhost</a> (struct lws *wsi)</td></tr>
<tr class="separator:ga06e77ce2916f8bc9826ef8d9d68e3932"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga94e6cc2223c4eec316b13bcebc3628b6"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga94e6cc2223c4eec316b13bcebc3628b6">lws_json_dump_vhost</a> (const struct lws_vhost *vh, char *buf, int len)</td></tr>
<tr class="separator:ga94e6cc2223c4eec316b13bcebc3628b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1dce5453d72a2037051aba5410e18135"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga1dce5453d72a2037051aba5410e18135">lws_json_dump_context</a> (const struct lws_context *context, char *buf, int len, int hide_vhosts)</td></tr>
<tr class="separator:ga1dce5453d72a2037051aba5410e18135"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeb12f934bfd178bd2132a9e73fc641da"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#gaeb12f934bfd178bd2132a9e73fc641da">lws_context_user</a> (struct lws_context *context)</td></tr>
<tr class="separator:gaeb12f934bfd178bd2132a9e73fc641da"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2>Context and Vhost releated functions</h2>
<p>LWS requires that there is one context, in which you may define multiple vhosts. Each vhost is a virtual host, with either its own listen port or sharing an existing one. Each vhost has its own SSL context that can be set up individually or left disabled.</p>
<p>If you don't care about multiple "site" support, you can ignore it and lws will create a single default vhost at context creation time. </p>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga41c2d763f78cc248df3b9f8645dbd2a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga41c2d763f78cc248df3b9f8645dbd2a5">&sect;&nbsp;</a></span>lws_context_options</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group__context-and-vhost.html#ga41c2d763f78cc248df3b9f8645dbd2a5">lws_context_options</a></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p>enum lws_context_options - context and vhost options </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092"></a>LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT&#160;</td><td class="fielddoc"><p>(VH) Don't allow the connection unless the client has a client cert that we recognize; provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c"></a>LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME&#160;</td><td class="fielddoc"><p>(CTX) Don't try to get the server's hostname </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d"></a>LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT&#160;</td><td class="fielddoc"><p>(VH) Allow non-SSL (plaintext) connections on the same port as SSL is listening... undermines the security of SSL; provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6"></a>LWS_SERVER_OPTION_LIBEV&#160;</td><td class="fielddoc"><p>(CTX) Use libev event loop </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9"></a>LWS_SERVER_OPTION_DISABLE_IPV6&#160;</td><td class="fielddoc"><p>(VH) Disable IPV6 support </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93"></a>LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS&#160;</td><td class="fielddoc"><p>(VH) Don't load OS CA certs, you will need to load your own CA cert(s) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc"></a>LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED&#160;</td><td class="fielddoc"><p>(VH) Accept connections with no valid Cert (eg, selfsigned) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f"></a>LWS_SERVER_OPTION_VALIDATE_UTF8&#160;</td><td class="fielddoc"><p>(VH) Check UT-8 correctness </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c"></a>LWS_SERVER_OPTION_SSL_ECDH&#160;</td><td class="fielddoc"><p>(VH) initialize ECDH ciphers </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e"></a>LWS_SERVER_OPTION_LIBUV&#160;</td><td class="fielddoc"><p>(CTX) Use libuv event loop </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada"></a>LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS&#160;</td><td class="fielddoc"><p>(VH) Use http redirect to force http to https (deprecated: use mount redirection) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a"></a>LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT&#160;</td><td class="fielddoc"><p>(CTX) Initialize the SSL library at all </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e"></a>LWS_SERVER_OPTION_EXPLICIT_VHOSTS&#160;</td><td class="fielddoc"><p>(CTX) Only create the context when calling context create api, implies user code will create its own vhosts </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941"></a>LWS_SERVER_OPTION_UNIX_SOCK&#160;</td><td class="fielddoc"><p>(VH) Use Unix socket </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016"></a>LWS_SERVER_OPTION_STS&#160;</td><td class="fielddoc"><p>(VH) Send Strict Transport Security header, making clients subsequently go to https even if user asked for http </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8"></a>LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY&#160;</td><td class="fielddoc"><p>(VH) Enable LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE to take effect </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160"></a>LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE&#160;</td><td class="fielddoc"><p>(VH) if set, only ipv6 allowed on the vhost </p>
</td></tr>
<tr><td class="fieldname"><a id="gga41c2d763f78cc248df3b9f8645dbd2a5a87a824b2e812f4c3e7f2c4a1ea4f8abd"></a>LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN&#160;</td><td class="fielddoc"><p>(CTX) Libuv only: Do not spin on SIGSEGV / SIGFPE. A segfault normally makes the lib spin so you can attach a debugger to it even if it happened without a debugger in place. You can disable that by giving this option. </p>
</td></tr>
</table>
<div class="fragment"><div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>&#160; {</div><div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092">LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT</a> = (1 &lt;&lt; 1) |</div><div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>&#160; (1 &lt;&lt; 12),</div><div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c">LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME</a> = (1 &lt;&lt; 2),</div><div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d">LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT</a> = (1 &lt;&lt; 3) |</div><div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>&#160; (1 &lt;&lt; 12),</div><div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6">LWS_SERVER_OPTION_LIBEV</a> = (1 &lt;&lt; 4),</div><div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9">LWS_SERVER_OPTION_DISABLE_IPV6</a> = (1 &lt;&lt; 5),</div><div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93">LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS</a> = (1 &lt;&lt; 6),</div><div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc">LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED</a> = (1 &lt;&lt; 7),</div><div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f">LWS_SERVER_OPTION_VALIDATE_UTF8</a> = (1 &lt;&lt; 8),</div><div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c">LWS_SERVER_OPTION_SSL_ECDH</a> = (1 &lt;&lt; 9) |</div><div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>&#160; (1 &lt;&lt; 12),</div><div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e">LWS_SERVER_OPTION_LIBUV</a> = (1 &lt;&lt; 10),</div><div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada">LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS</a> = (1 &lt;&lt; 11) |</div><div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>&#160; (1 &lt;&lt; 12),</div><div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a">LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT</a> = (1 &lt;&lt; 12),</div><div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e">LWS_SERVER_OPTION_EXPLICIT_VHOSTS</a> = (1 &lt;&lt; 13),</div><div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941">LWS_SERVER_OPTION_UNIX_SOCK</a> = (1 &lt;&lt; 14),</div><div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016">LWS_SERVER_OPTION_STS</a> = (1 &lt;&lt; 15),</div><div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8">LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY</a> = (1 &lt;&lt; 16),</div><div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160">LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE</a> = (1 &lt;&lt; 17),</div><div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>&#160; <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a87a824b2e812f4c3e7f2c4a1ea4f8abd">LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN</a> = (1 &lt;&lt; 18),</div><div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>&#160; <span class="comment">/****** add new things just above ---^ ******/</span></div><div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>&#160;};</div><div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092">LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1525</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93">LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1541</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a87a824b2e812f4c3e7f2c4a1ea4f8abd"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a87a824b2e812f4c3e7f2c4a1ea4f8abd">LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1571</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada">LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1553</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e">LWS_SERVER_OPTION_EXPLICIT_VHOSTS</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1559</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c">LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1530</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c">LWS_SERVER_OPTION_SSL_ECDH</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1548</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d">LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1532</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6">LWS_SERVER_OPTION_LIBEV</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1537</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a">LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1557</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160">LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1569</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9">LWS_SERVER_OPTION_DISABLE_IPV6</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1539</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e">LWS_SERVER_OPTION_LIBUV</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1551</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941">LWS_SERVER_OPTION_UNIX_SOCK</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1562</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f">LWS_SERVER_OPTION_VALIDATE_UTF8</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1546</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc">LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1544</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016">LWS_SERVER_OPTION_STS</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1564</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8">LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1567</div></div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga1863f0a15ab9da0f07be7bd66230d232"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1863f0a15ab9da0f07be7bd66230d232">&sect;&nbsp;</a></span>lws_context_deprecate()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN void lws_context_deprecate </td>
<td>(</td>
<td class="paramtype">struct lws_context *&#160;</td>
<td class="paramname"><em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">lws_reload_func&#160;</td>
<td class="paramname"><em>cb</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga1863f0a15ab9da0f07be7bd66230d232">lws_context_deprecate()</a> - Deprecate the websocket context </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">context</td><td>Websocket context <pre class="fragment"> This function is used on an existing context before superceding it
with a new context.
It closes any listen sockets in the context, so new connections are
not possible.
And it marks the context to be deleted when the number of active
connections into it falls to zero.
Otherwise if you attach the deprecated context to the replacement
context when it has been created using lws_context_attach_deprecated()
both any deprecated and the new context will service their connections.
This is aimed at allowing seamless configuration reloads.
The callback cb will be called after the listen sockets are actually
closed and may be reopened. In the callback the new context should be
configured and created. (With libuv, socket close happens async after
more loop events).</pre> </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga8ee0314028755f1ddfa9428e09b4fddb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8ee0314028755f1ddfa9428e09b4fddb">&sect;&nbsp;</a></span>lws_context_destroy()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN void lws_context_destroy </td>
<td>(</td>
<td class="paramtype">struct lws_context *&#160;</td>
<td class="paramname"><em>context</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga8ee0314028755f1ddfa9428e09b4fddb">lws_context_destroy()</a> - Destroy the websocket context </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">context</td><td>Websocket context <pre class="fragment"> This function closes any active connections and then frees the
context. After calling this, any further use of the context is
undefined.</pre> </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gaeb12f934bfd178bd2132a9e73fc641da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeb12f934bfd178bd2132a9e73fc641da">&sect;&nbsp;</a></span>lws_context_user()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN void* lws_context_user </td>
<td>(</td>
<td class="paramtype">struct lws_context *&#160;</td>
<td class="paramname"><em>context</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#gaeb12f934bfd178bd2132a9e73fc641da">lws_context_user()</a> - get the user data associated with the context </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">context</td><td>Websocket context</td></tr>
</table>
</dd>
</dl>
<p>This returns the optional user allocation that can be attached to the context the sockets live in at context_create time. It's a way to let all sockets serviced in the same context share data without using globals statics in the user code. </p>
</div>
</div>
<a id="gaf2fff58562caab7510c41eeac85a8648"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf2fff58562caab7510c41eeac85a8648">&sect;&nbsp;</a></span>lws_create_context()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN struct lws_context* lws_create_context </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *&#160;</td>
<td class="paramname"><em>info</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#gaf2fff58562caab7510c41eeac85a8648">lws_create_context()</a> - Create the websocket handler </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">info</td><td>pointer to struct with parameters <pre class="fragment"> This function creates the listening socket (if serving) and takes care
of all initialization in one step.
If option LWS_SERVER_OPTION_EXPLICIT_VHOSTS is given, no vhost is
created; you're expected to create your own vhosts afterwards using
lws_create_vhost(). Otherwise a vhost named "default" is also created
using the information in the vhost-related members, for compatibility.
After initialization, it returns a struct lws_context * that
represents this server. After calling, user code needs to take care
of calling lws_service() with the context pointer to get the
server's sockets serviced. This must be done in the same process
context as the initialization call.
The protocol callback functions are called for a handful of events
including http requests coming in, websocket connections becoming
established, and data arriving; it's also called periodically to allow
async transmission.
HTTP requests are sent always to the FIRST protocol in protocol, since
at that time websocket protocol has not been negotiated. Other
protocols after the first one never see any HTTP callback activity.
The server created is a simple http server by default; part of the
websocket standard is upgrading this http connection to a websocket one.
This allows the same server to provide files like scripts and favicon /
images or whatever over http and dynamic data over websockets all in
one place; they're all handled in the user callback.</pre> </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga0c54c667ccd9b8b3dddcd123ca72f87c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0c54c667ccd9b8b3dddcd123ca72f87c">&sect;&nbsp;</a></span>lws_create_vhost()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_EXTERN LWS_VISIBLE struct lws_vhost* lws_create_vhost </td>
<td>(</td>
<td class="paramtype">struct lws_context *&#160;</td>
<td class="paramname"><em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *&#160;</td>
<td class="paramname"><em>info</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga0c54c667ccd9b8b3dddcd123ca72f87c">lws_create_vhost()</a> - Create a vhost (virtual server context) </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">context</td><td>pointer to result of <a class="el" href="group__context-and-vhost.html#gaf2fff58562caab7510c41eeac85a8648">lws_create_context()</a> </td></tr>
<tr><td class="paramname">info</td><td>pointer to struct with parameters</td></tr>
</table>
</dd>
</dl>
<p>This function creates a virtual server (vhost) using the vhost-related members of the info struct. You can create many vhosts inside one context if you created the context with the option LWS_SERVER_OPTION_EXPLICIT_VHOSTS </p>
</div>
</div>
<a id="ga06e77ce2916f8bc9826ef8d9d68e3932"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga06e77ce2916f8bc9826ef8d9d68e3932">&sect;&nbsp;</a></span>lws_get_vhost()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN struct lws_vhost* lws_get_vhost </td>
<td>(</td>
<td class="paramtype">struct lws *&#160;</td>
<td class="paramname"><em>wsi</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga06e77ce2916f8bc9826ef8d9d68e3932">lws_get_vhost()</a> - return the vhost a wsi belongs to</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">wsi</td><td>which connection </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga1dce5453d72a2037051aba5410e18135"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1dce5453d72a2037051aba5410e18135">&sect;&nbsp;</a></span>lws_json_dump_context()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN int lws_json_dump_context </td>
<td>(</td>
<td class="paramtype">const struct lws_context *&#160;</td>
<td class="paramname"><em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>hide_vhosts</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga1dce5453d72a2037051aba5410e18135">lws_json_dump_context()</a> - describe context state and stats in JSON</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">context</td><td>the context </td></tr>
<tr><td class="paramname">buf</td><td>buffer to fill with JSON </td></tr>
<tr><td class="paramname">len</td><td>max length of buf </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga94e6cc2223c4eec316b13bcebc3628b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga94e6cc2223c4eec316b13bcebc3628b6">&sect;&nbsp;</a></span>lws_json_dump_vhost()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN int lws_json_dump_vhost </td>
<td>(</td>
<td class="paramtype">const struct lws_vhost *&#160;</td>
<td class="paramname"><em>vh</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>len</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga94e6cc2223c4eec316b13bcebc3628b6">lws_json_dump_vhost()</a> - describe vhost state and stats in JSON</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">vh</td><td>the vhost </td></tr>
<tr><td class="paramname">buf</td><td>buffer to fill with JSON </td></tr>
<tr><td class="paramname">len</td><td>max length of buf </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga7e9d5405547a457d86e0b4f0ae2bb1c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7e9d5405547a457d86e0b4f0ae2bb1c4">&sect;&nbsp;</a></span>lws_set_proxy()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN int lws_set_proxy </td>
<td>(</td>
<td class="paramtype">struct lws_vhost *&#160;</td>
<td class="paramname"><em>vhost</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>proxy</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga7e9d5405547a457d86e0b4f0ae2bb1c4">lws_set_proxy()</a> - Setups proxy to lws_context. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">vhost</td><td>pointer to struct lws_vhost you want set proxy for </td></tr>
<tr><td class="paramname">proxy</td><td>pointer to c string containing proxy in format address:port</td></tr>
</table>
</dd>
</dl>
<p>Returns 0 if proxy string was parsed and proxy was setup. Returns -1 if proxy is NULL or has incorrect format.</p>
<p>This is only required if your OS does not provide the http_proxy environment variable (eg, OSX)</p>
<p>IMPORTANT! You should call this function right after creation of the lws_context and before call to connect. If you call this function after connect behavior is undefined. This function will override proxy settings made on lws_context creation with genenv() call. </p>
</div>
</div>
<a id="ga8db03e19a372e34ac25cf21af894a02c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8db03e19a372e34ac25cf21af894a02c">&sect;&nbsp;</a></span>lws_vhost_get()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN struct lws_vhost* lws_vhost_get </td>
<td>(</td>
<td class="paramtype">struct lws *&#160;</td>
<td class="paramname"><em>wsi</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga8db03e19a372e34ac25cf21af894a02c">lws_vhost_get()</a> -</p><dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>deprecated: use <a class="el" href="group__context-and-vhost.html#ga06e77ce2916f8bc9826ef8d9d68e3932">lws_get_vhost()</a> </dd></dl>
</div>
</div>
<a id="ga98d88c9080fd89c37114363a6474ea73"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga98d88c9080fd89c37114363a6474ea73">&sect;&nbsp;</a></span>lwsws_get_config_globals()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN int lwsws_get_config_globals </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *&#160;</td>
<td class="paramname"><em>info</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>d</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char **&#160;</td>
<td class="paramname"><em>config_strings</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>len</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga98d88c9080fd89c37114363a6474ea73">lwsws_get_config_globals()</a> - Parse a JSON server config file </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">info</td><td>pointer to struct with parameters </td></tr>
<tr><td class="paramname">d</td><td>filepath of the config file </td></tr>
<tr><td class="paramname">config_strings</td><td>storage for the config strings extracted from JSON, the pointer is incremented as strings are stored </td></tr>
<tr><td class="paramname">len</td><td>pointer to the remaining length left in config_strings the value is decremented as strings are stored</td></tr>
</table>
</dd>
</dl>
<p>This function prepares a n <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> struct with global settings from a file d.</p>
<p>Requires CMake option LWS_WITH_LEJP_CONF to have been enabled </p>
</div>
</div>
<a id="ga341064721add2618ae1b29717493a212"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga341064721add2618ae1b29717493a212">&sect;&nbsp;</a></span>lwsws_get_config_vhosts()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LWS_VISIBLE LWS_EXTERN int lwsws_get_config_vhosts </td>
<td>(</td>
<td class="paramtype">struct lws_context *&#160;</td>
<td class="paramname"><em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *&#160;</td>
<td class="paramname"><em>info</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>d</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char **&#160;</td>
<td class="paramname"><em>config_strings</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>len</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga341064721add2618ae1b29717493a212">lwsws_get_config_vhosts()</a> - Create vhosts from a JSON server config file </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">context</td><td>pointer to result of <a class="el" href="group__context-and-vhost.html#gaf2fff58562caab7510c41eeac85a8648">lws_create_context()</a> </td></tr>
<tr><td class="paramname">info</td><td>pointer to struct with parameters </td></tr>
<tr><td class="paramname">d</td><td>filepath of the config file </td></tr>
<tr><td class="paramname">config_strings</td><td>storage for the config strings extracted from JSON, the pointer is incremented as strings are stored </td></tr>
<tr><td class="paramname">len</td><td>pointer to the remaining length left in config_strings the value is decremented as strings are stored</td></tr>
</table>
</dd>
</dl>
<p>This function creates vhosts into a context according to the settings in JSON files found in directory d.</p>
<p>Requires CMake option LWS_WITH_LEJP_CONF to have been enabled </p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
</ul>
</div>
</body>
</html>