diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/http.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/http.cc b/src/http.cc index 3dff64e..c755442 100644 --- a/src/http.cc +++ b/src/http.cc @@ -51,6 +51,15 @@ int callback_http(struct libwebsocket_context * context, break; } + // script + if(in && strcmp((const char *)in, "/proto.js") == 0) { + if(libwebsockets_serve_http_file(wsi, + LOCAL_RESOURCE_PATH"/proto.js", + "text/javascript")) + fprintf(stderr, "Failed to send javascript\n"); + break; + } + /* send the script... when it runs it'll start websockets */ if(libwebsockets_serve_http_file(wsi, |