diff --git a/README.lwsws.md b/README.lwsws.md
index 63b026686ecb7ba24fd91cefc23081a2627bc49b..9d6c82a3bb993a2ff203f594e41a3792e7804648 100644
--- a/README.lwsws.md
+++ b/README.lwsws.md
@@ -146,7 +146,7 @@ Vhosts can select which plugins they want to offer and give them per-vhost setti
 
 ```	
      "ws-protocols": [{
-       "warmcat,timezoom": {
+       "warmcat-timezoom": {
          "status": "ok"
        }
      }]
@@ -157,6 +157,19 @@ The "x":"y" parameters like "status":"ok" are made available to the protocol dur
 LWS_CALLBACK_PROTOCOL_INIT (@in is a pointer to a linked list of struct lws_protocol_vhost_options
 containing the name and value pointers).
 
+To indicate that a protocol should be used when no Protocol: header is sent
+by the client, you can use "default": "1"
+
+```	
+     "ws-protocols": [{
+       "warmcat-timezoom": {
+         "status": "ok",
+         "default": "1"
+       }
+     }]
+
+```
+
 
 Other vhost options
 -------------------
diff --git a/changelog b/changelog
index a6db586240fcad2ea5fc945e393a4111c0fb4aa0..c135caba5dfb64142beec1cd6a734d65337b688d 100644
--- a/changelog
+++ b/changelog
@@ -26,7 +26,8 @@ Fixes
 	.woff   application/font-woff
 	.xml    application/xml
 
-
+5) Allow per-vhost setting of which protocol should get used
+when the protocol: header is not sent by the client
 
 
 v2.0.0
diff --git a/lib/context.c b/lib/context.c
index 23d218d02fbdbf6d70b99dc55b80ad85c9005596..8c0a69be97e0abe79229ac65329dd3e7f051d5c6 100644
--- a/lib/context.c
+++ b/lib/context.c
@@ -111,13 +111,15 @@ int
 lws_protocol_init(struct lws_context *context)
 {
 	struct lws_vhost *vh = context->vhost_list;
-	const struct lws_protocol_vhost_options *pvo;
+	const struct lws_protocol_vhost_options *pvo, *pvo1;
 	struct lws wsi;
 	int n;
 
 	memset(&wsi, 0, sizeof(wsi));
 	wsi.context = context;
 
+	lwsl_notice("%s\n", __func__);
+
 	while (vh) {
 		wsi.vhost = vh;
 
@@ -128,12 +130,32 @@ lws_protocol_init(struct lws_context *context)
 
 			pvo = lws_vhost_protocol_options(vh,
 							 vh->protocols[n].name);
-			if (pvo)
+			if (pvo) {
 				/*
 				 * linked list of options specific to
 				 * vh + protocol
 				 */
-				pvo = pvo->options;
+				pvo1 = pvo;
+				pvo = pvo1->options;
+
+				while (pvo) {
+					lwsl_notice("    vh %s prot %s opt %s\n",
+							vh->name,
+							vh->protocols[n].name,
+							pvo->name);
+
+					if (!strcmp(pvo->name, "default")) {
+						lwsl_notice("Setting default "
+						   "protocol for vh %s to %s\n",
+						   vh->name,
+						   vh->protocols[n].name);
+						vh->default_protocol_index = n;
+					}
+					pvo = pvo->next;
+				}
+
+				pvo = pvo1->options;
+			}
 
 			/*
 			 * inform all the protocols that they are doing their one-time
diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h
index cb1976be9905c7c304b63d50bd9f29ecad2cee8a..4ed08953a021c91bef43ff988017d21f7660c063 100644
--- a/lib/private-libwebsockets.h
+++ b/lib/private-libwebsockets.h
@@ -678,6 +678,7 @@ struct lws_vhost {
 	int allow_non_ssl_on_ssl_port;
 	unsigned int user_supplied_ssl_ctx:1;
 #endif
+	unsigned char default_protocol_index;
 };
 
 /*
diff --git a/lib/server.c b/lib/server.c
index 0e06cfa413c293430732e436b03b119d437561a5..1343a243735d718c6048c39cbc3ed1f8a35571f7 100644
--- a/lib/server.c
+++ b/lib/server.c
@@ -942,11 +942,14 @@ upgrade_ws:
 			/*
 			 * some clients only have one protocol and
 			 * do not send the protocol list header...
-			 * allow it and match to protocol 0
+			 * allow it and match to the vhost's default
+			 * protocol (which itself defaults to zero)
 			 */
-			lwsl_info("defaulting to prot 0 handler\n");
+			lwsl_info("defaulting to prot handler %d\n",
+				wsi->vhost->default_protocol_index);
 			n = 0;
-			wsi->protocol = &wsi->vhost->protocols[0];
+			wsi->protocol = &wsi->vhost->protocols[
+				      (int)wsi->vhost->default_protocol_index];
 		}
 
 		/* allocate wsi->user storage */