diff --git a/lib/context.c b/lib/context.c
index 604f7cb2dabec21d0ad15016fae0fcdd7a0c08d1..705f8ea0746ba7222a0c43e5d3d2df458e0a1f58 100644
--- a/lib/context.c
+++ b/lib/context.c
@@ -482,6 +482,7 @@ lws_create_vhost(struct lws_context *context,
 	vh->options = info->options;
 	vh->pvo = info->pvo;
 	vh->headers = info->headers;
+	vh->user = info->user;
 	vh->ssl_info_event_mask = info->ssl_info_event_mask;
 	if (info->keepalive_timeout)
 		vh->keepalive_timeout = info->keepalive_timeout;
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index 780d220fae989850014791166dcd108a12fa5037..ff2d40097ff93b28e35d1d08ff18a475f2597f4d 100755
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -1011,6 +1011,12 @@ bail:
 
 }
 
+LWS_EXTERN void *
+lws_vhost_user(struct lws_vhost *vhost)
+{
+	return vhost->user;
+}
+
 LWS_EXTERN void *
 lws_context_user(struct lws_context *context)
 {
diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h
index ba05028d69916f114fa8f819a7991019e7da4c99..9a08a05faaa47cc537187df5b1947d118bb36a3b 100644
--- a/lib/libwebsockets.h
+++ b/lib/libwebsockets.h
@@ -1935,8 +1935,14 @@ struct lws_context_creation_info {
 	unsigned int options;
 	/**< VHOST + CONTEXT: 0, or LWS_SERVER_OPTION_... bitfields */
 	void *user;
-	/**< CONTEXT: optional user pointer that can be recovered via the context
-	 *		pointer using lws_context_user */
+	/**< VHOST + CONTEXT: optional user pointer that will be associated
+	 * with the context when creating the context (and can be retrieved by
+	 * lws_context_user(context), or with the vhost when creating the vhost
+	 * (and can be retrieved by lws_vhost_user(vhost)).  You will need to
+	 * use LWS_SERVER_OPTION_EXPLICIT_VHOSTS and create the vhost separately
+	 * if you care about giving the context and vhost different user pointer
+	 * values.
+	 */
 	int ka_time;
 	/**< CONTEXT: 0 for no TCP keepalive, otherwise apply this keepalive
 	 * timeout to all libwebsocket sockets, client or server */
@@ -2349,6 +2355,17 @@ LWS_VISIBLE LWS_EXTERN int
 lws_json_dump_context(const struct lws_context *context, char *buf, int len,
 		      int hide_vhosts);
 
+/**
+ * lws_vhost_user() - get the user data associated with the vhost
+ * \param vhost: Websocket vhost
+ *
+ * This returns the optional user pointer that can be attached to
+ * a vhost when it was created.  Lws never dereferences this pointer, it only
+ * sets it when the vhost is created, and returns it using this api.
+ */
+LWS_VISIBLE LWS_EXTERN void *
+lws_vhost_user(struct lws_vhost *vhost);
+
 /**
  * lws_context_user() - get the user data associated with the context
  * \param context: Websocket context
diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h
index a6a2a5624beac5e37d7c83b43fcbe234755af4bd..4830a2ec364e850047448027c5f97714e6eacdd8 100644
--- a/lib/private-libwebsockets.h
+++ b/lib/private-libwebsockets.h
@@ -881,6 +881,7 @@ struct lws_vhost {
 #ifndef LWS_NO_EXTENSIONS
 	const struct lws_extension *extensions;
 #endif
+	void *user;
 
 	int listen_port;
 	unsigned int http_proxy_port;