diff --git a/README.coding.md b/README.coding.md index b4fc8113..b53a2e7e 100644 --- a/README.coding.md +++ b/README.coding.md @@ -524,8 +524,7 @@ afterwards to attach one or more vhosts manually. ``` LWS_VISIBLE struct lws_vhost * lws_create_vhost(struct lws_context *context, - struct lws_context_creation_info *info, - struct lws_http_mount *mounts); + struct lws_context_creation_info *info); ``` lws_create_vhost() uses the same info struct as lws_create_context(), diff --git a/doc/html/md_README.coding.html b/doc/html/md_README.coding.html index b17b8a49..0964220e 100644 --- a/doc/html/md_README.coding.html +++ b/doc/html/md_README.coding.html @@ -223,7 +223,7 @@ Client connections as HTTP[S] rather than WS[S]

Using lws vhosts

If you set LWS_SERVER_OPTION_EXPLICIT_VHOSTS options flag when you create your context, it won't create a default vhost using the info struct members for compatibility. Instead you can call lws_create_vhost() afterwards to attach one or more vhosts manually.

-
1 LWS_VISIBLE struct lws_vhost *
2 lws_create_vhost(struct lws_context *context,
3  struct lws_context_creation_info *info,
4  struct lws_http_mount *mounts);

lws_create_vhost() uses the same info struct as lws_create_context(), it ignores members related to context and uses the ones meaningful for vhost (marked with VH in libwebsockets.h).

+
1 LWS_VISIBLE struct lws_vhost *
2 lws_create_vhost(struct lws_context *context,
3  struct lws_context_creation_info *info);

lws_create_vhost() uses the same info struct as lws_create_context(), it ignores members related to context and uses the ones meaningful for vhost (marked with VH in libwebsockets.h).

1 struct lws_context_creation_info {
2  int port; /* VH */
3  const char *iface; /* VH */
4  const struct lws_protocols *protocols; /* VH */
5  const struct lws_extension *extensions; /* VH */
6 ...

When you attach the vhost, if the vhost's port already has a listen socket then both vhosts share it and use SNI (is SSL in use) or the Host: header from the client to select the right one. Or if no other vhost already listening the a new listen socket is created.

There are some new members but mainly it's stuff you used to set at context creation time.