From 2254587e62f050edd11af9e182b65aff3184eba6 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 17 Jan 2013 13:47:09 +0100 Subject: Split protocol and handler code apart. --- src/http.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/http.cc b/src/http.cc index 8aa83c3..6b14ed5 100644 --- a/src/http.cc +++ b/src/http.cc @@ -62,6 +62,14 @@ int callback_http(struct libwebsocket_context * context, break; } + if(in && strcmp((const char *)in, "/handler.js") == 0) { + if(libwebsockets_serve_http_file(wsi, + LOCAL_RESOURCE_PATH"/handler.js", + "text/javascript")) + DEBUG(httpd,"Failed to send javascript\n"); + break; + } + /* send the script... when it runs it'll start websockets */ if(libwebsockets_serve_http_file(wsi, -- cgit v1.2.3