{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1759007511,
"reponame":"libwebsockets",
"desc":"libwebsockets lightweight C networking library",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"669fc16e04d06b42bce107aee29aeedf",
"oid":{ "oid": "8860eddeb2a748bca16e8ed9ad2adc874166f078", "alias": []},"blobname": "doc/latex/md_README.build.tex", "blob": "\u005csubsection*{Introduction to C\u005c+Make }\n\nC\u005c+Make is a multi-\u005c/platform build tool that can generate build files for many different target platforms. See more info at \u005chref{http://www.cmake.org}{\u005ctt http\u005c+://www.\u005c+cmake.\u005c+org}\n\nC\u005c+Make also allows/recommends you to do \u005cchar`\u005c\u0022{}out of source\u005cchar`\u005c\u0022{}-\u005c/builds, that is, the build files are separated from your sources, so there is no need to create elaborate clean scripts to get a clean source tree, instead you simply remove your build directory.\n\nLibwebsockets has been tested to build successfully on the following platforms with S\u005c+SL support (both Open\u005c+S\u005c+S\u005c+L/wolf\u005c+S\u005c+SL)\u005c+:\n\n\n\u005cbegin{DoxyItemize}\n\u005citem Windows (Visual Studio)\n\u005citem Windows (Min\u005c+GW)\n\u005citem Linux (x86 and A\u005c+RM)\n\u005citem O\u005c+SX\n\u005citem Net\u005c+B\u005c+SD\n\u005cend{DoxyItemize}\n\n\u005csubsection*{Building the library and test apps }\n\nThe project settings used by C\u005c+Make to generate the platform specific build files is called \u005chref{CMakeLists.txt}{\u005ctt C\u005c+Make\u005c+Lists.\u005c+txt}. C\u005c+Make then uses one of its \u005cchar`\u005c\u0022{}\u005c+Generators\u005cchar`\u005c\u0022{} to output a Visual Studio project or Make file for instance. To see a list of the available generators for your platform, simply run the \u005cchar`\u005c\u0022{}cmake\u005cchar`\u005c\u0022{} command.\n\nNote that by default Open\u005c+S\u005c+SL will be linked, if you don\u005ctextquotesingle{}t want S\u005c+SL support see below on how to toggle compile options.\n\n\u005csubsection*{Building on Unix\u005c+: }\n\n\n\u005cbegin{DoxyEnumerate}\n\u005citem Install C\u005c+Make 2.\u005c+8 or greater\u005c+: \u005chref{http://cmake.org/cmake/resources/software.html}{\u005ctt http\u005c+://cmake.\u005c+org/cmake/resources/software.\u005c+html} (Most Unix distributions comes with a packaged version also)\n\u005citem Install Open\u005c+S\u005c+SL.\n\u005citem Generate the build files (default is Make files)\u005c+: \n\u005cbegin{DoxyCode}\n1 $ cd /path/to/src\n2 $ mkdir build\n3 $ cd build\n4 $ cmake ..\n\u005cend{DoxyCode}\n\n\u005citem Finally you can build using the generated Makefile\u005c+: \n\u005cbegin{DoxyCode}\n1 $ make \u0026\u0026 sudo make install\n\u005cend{DoxyCode}\n {\u005cbfseries N\u005c+O\u005c+TE}\u005c+: The {\u005cttfamily build/}{\u005cttfamily directory can have any name and be located anywhere on your filesystem, and that the argument}..` given to cmake is simply the source directory of {\u005cbfseries libwebsockets} containing the \u005chref{CMakeLists.txt}{\u005ctt C\u005c+Make\u005c+Lists.\u005c+txt} project file. All examples in this file assumes you use \u005cchar`\u005c\u0022{}..\u005cchar`\u005c\u0022{}\n\u005cend{DoxyEnumerate}\n\n{\u005cbfseries N\u005c+O\u005c+T\u005c+E2}\u005c+: A common option you may want to give is to set the install path, same as --prefix\u003d with autotools. It defaults to /usr/local. You can do this by, eg \n\u005cbegin{DoxyCode}\n1 $ cmake -DCMAKE\u005c_INSTALL\u005c_PREFIX:PATH\u003d/usr .\n\u005cend{DoxyCode}\n\n\n{\u005cbfseries N\u005c+O\u005c+T\u005c+E3}\u005c+: On machines that want libraries in lib64, you can also add the following to the cmake line \n\u005cbegin{DoxyCode}\n1 -DLIB\u005c_SUFFIX\u003d64\n\u005cend{DoxyCode}\n\n\n{\u005cbfseries N\u005c+O\u005c+T\u005c+E4}\u005c+: If you are building against a non-\u005c/distro Open\u005c+S\u005c+SL (eg, in order to get access to A\u005c+L\u005c+PN support only in newer Open\u005c+S\u005c+SL versions) the nice way to express that in one cmake command is eg, \n\u005cbegin{DoxyCode}\n1 $ cmake .. -DOPENSSL\u005c_ROOT\u005c_DIR\u003d/usr/local/ssl \u005c(\u005cbackslash\u005c)\n2 -DCMAKE\u005c_INCLUDE\u005c_DIRECTORIES\u005c_PROJECT\u005c_BEFORE\u003d/usr/local/ssl \u005c(\u005cbackslash\u005c)\n3 -DLWS\u005c_WITH\u005c_HTTP2\u003d1\n\u005cend{DoxyCode}\n\n\nWhen you run the test apps using non-\u005c/distro S\u005c+SL, you have to force them to use your libs, not the distro ones \n\u005cbegin{DoxyCode}\n1 $ LD\u005c_LIBRARY\u005c_PATH\u003d/usr/local/ssl/lib libwebsockets-test-server --ssl\n\u005cend{DoxyCode}\n\n\nTo get it to build on latest openssl (2016-\u005c/04-\u005c/10) it needed this approach \n\u005cbegin{DoxyCode}\n1 cmake .. -DLWS\u005c_WITH\u005c_HTTP2\u003d1 -DLWS\u005c_OPENSSL\u005c_INCLUDE\u005c_DIRS\u003d/usr/local/include/openssl\n -DLWS\u005c_OPENSSL\u005c_LIBRARIES\u003d\u0022/usr/local/lib64/libssl.so;/usr/local/lib64/libcrypto.so\u0022\n\u005cend{DoxyCode}\n\n\n{\u005cbfseries N\u005c+O\u005c+T\u005c+E5}\u005c+: To build with debug info and \u005c+\u005c_\u005c+\u005c+D\u005c+E\u005c+B\u005c+UG for lower priority debug messages compiled in, use \n\u005cbegin{DoxyCode}\n1 $ cmake .. -DCMAKE\u005c_BUILD\u005c_TYPE\u003dDEBUG\n\u005cend{DoxyCode}\n\n\n\u005csubsection*{Quirk of cmake }\n\nWhen changing cmake options, for some reason the only way to get it to see the changes sometimes is delete the contents of your build directory and do the cmake from scratch.\n\n\u005csubsection*{Building on Windows (Visual Studio) }\n\n\n\u005cbegin{DoxyEnumerate}\n\u005citem Install C\u005c+Make 2.\u005c+6 or greater\u005c+: \u005chref{http://cmake.org/cmake/resources/software.html}{\u005ctt http\u005c+://cmake.\u005c+org/cmake/resources/software.\u005c+html}\n\u005citem Install Open\u005c+S\u005c+SL binaries. \u005chref{http://www.openssl.org/related/binaries.html}{\u005ctt http\u005c+://www.\u005c+openssl.\u005c+org/related/binaries.\u005c+html}\n\n({\u005cbfseries N\u005c+O\u005c+TE}\u005c+: Preferably in the default location to make it easier for C\u005c+Make to find them)\n\n{\u005cbfseries N\u005c+O\u005c+T\u005c+E2}\u005c+: Be sure that O\u005c+P\u005c+E\u005c+N\u005c+S\u005c+S\u005c+L\u005c+\u005c_\u005c+\u005c+C\u005c+O\u005c+NF environment variable is defined and points at $\u003c$\u005c+Open\u005c+S\u005c+S\u005c+L install\u003d\u005cchar`\u005c\u0022{}\u005cchar`\u005c\u0022{} location$\u003e$\u003d\u005cchar`\u005c\u0022{}\u005cchar`\u005c\u0022{}$\u003e$.cfg\n\u005citem Generate the Visual studio project by opening the Visual Studio cmd prompt\u005c+:\n\u005cend{DoxyEnumerate}\n\n\n\u005cbegin{DoxyCode}\n1 cd \u003cpath to src\u003e\n2 md build\n3 cd build\n4 cmake -G \u0022Visual Studio 10\u0022 ..\n\u005cend{DoxyCode}\n\n\n({\u005cbfseries N\u005c+O\u005c+TE}\u005c+: There is also a cmake-\u005c/gui available on Windows if you prefer that)\n\n{\u005cbfseries N\u005c+O\u005c+T\u005c+E2}\u005c+: See this link to find out the version number corresponding to your Visual Studio edition\u005c+: \u005chref{http://superuser.com/a/194065}{\u005ctt http\u005c+://superuser.\u005c+com/a/194065}\n\n\n\u005cbegin{DoxyEnumerate}\n\u005citem Now you should have a generated Visual Studio Solution in your {\u005cttfamily $\u003c$path to src$\u003e$/build} directory, which can be used to build.\n\u005citem Some additional deps may be needed\n\u005cbegin{DoxyItemize}\n\u005citem iphlpapi.\u005c+lib\n\u005citem psapi.\u005c+lib\n\u005citem userenv.\u005c+lib\n\u005cend{DoxyItemize}\n\u005citem If you\u005ctextquotesingle{}re using libuv, you must make sure to compile libuv with the same multithread-\u005c/dll / Mtd attributes as libwebsockets itself\n\u005cend{DoxyEnumerate}\n\n\u005csubsection*{Building on Windows (Min\u005c+GW) }\n\n\n\u005cbegin{DoxyEnumerate}\n\u005citem Install Min\u005c+GW\u005c+: \u005chref{http://sourceforge.net/projects/mingw/files}{\u005ctt http\u005c+://sourceforge.\u005c+net/projects/mingw/files}\n\n({\u005cbfseries N\u005c+O\u005c+TE}\u005c+: Preferably in the default location C\u005c+:)\n\u005citem Fix up Min\u005c+GW headers\n\na) Add the following lines to C\u005c+:.h\u005c+: \n\u005cbegin{DoxyCode}\n1 #if(\u005c_WIN32\u005c_WINNT \u003e\u003d 0x0600)\n2 \n3 typedef struct pollfd \u005c{\n4 \n5 SOCKET fd;\n6 SHORT events;\n7 SHORT revents;\n8 \n9 \u005c} WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD;\n10 \n11 WINSOCK\u005c_API\u005c_LINKAGE int WSAAPI WSAPoll(LPWSAPOLLFD fdArray, ULONG fds, INT timeout);\n12 \n13 #endif // (\u005c_WIN32\u005c_WINNT \u003e\u003d 0x0600)\n\u005cend{DoxyCode}\n b) Create C\u005c+:.h and copy and paste the content from following link into it\u005c+:\n\n\u005chref{http://wine-unstable.sourcearchive.com/documentation/1.1.32/mstcpip_8h-source.html}{\u005ctt http\u005c+://wine-\u005c/unstable.\u005c+sourcearchive.\u005c+com/documentation/1.\u005c+1.\u005c+32/mstcpip\u005c+\u005c_\u005c+8h-\u005c/source.\u005c+html}\n\u005citem Install C\u005c+Make 2.\u005c+6 or greater\u005c+: \u005chref{http://cmake.org/cmake/resources/software.html}{\u005ctt http\u005c+://cmake.\u005c+org/cmake/resources/software.\u005c+html}\n\u005citem Install Open\u005c+S\u005c+SL binaries. \u005chref{http://www.openssl.org/related/binaries.html}{\u005ctt http\u005c+://www.\u005c+openssl.\u005c+org/related/binaries.\u005c+html}\n\n({\u005cbfseries N\u005c+O\u005c+TE}\u005c+: Preferably in the default location to make it easier for C\u005c+Make to find them)\n\n{\u005cbfseries N\u005c+O\u005c+T\u005c+E2}\u005c+: Be sure that O\u005c+P\u005c+E\u005c+N\u005c+S\u005c+S\u005c+L\u005c+\u005c_\u005c+\u005c+C\u005c+O\u005c+NF environment variable is defined and points at $\u003c$\u005c+Open\u005c+S\u005c+S\u005c+L install\u003d\u005cchar`\u005c\u0022{}\u005cchar`\u005c\u0022{} location$\u003e$\u003d\u005cchar`\u005c\u0022{}\u005cchar`\u005c\u0022{}$\u003e$.cfg\n\u005citem Generate the build files (default is Make files) using M\u005c+S\u005c+YS shell\u005c+: \n\u005cbegin{DoxyCode}\n1 $ cd /drive/path/to/src\n2 $ mkdir build\n3 $ cd build\n4 $ cmake -G \u0022MSYS Makefiles\u0022 -DCMAKE\u005c_INSTALL\u005c_PREFIX\u003dC:/MinGW ..\n\u005cend{DoxyCode}\n ({\u005cbfseries N\u005c+O\u005c+TE}\u005c+: The {\u005cttfamily build/}{\u005cttfamily directory can have any name and be located anywhere on your filesystem, and that the argument}..` given to cmake is simply the source directory of {\u005cbfseries libwebsockets} containing the \u005chref{CMakeLists.txt}{\u005ctt C\u005c+Make\u005c+Lists.\u005c+txt} project file. All examples in this file assumes you use \u005cchar`\u005c\u0022{}..\u005cchar`\u005c\u0022{})\n\n{\u005cbfseries N\u005c+O\u005c+T\u005c+E2}\u005c+: To generate build files allowing to create libwebsockets binaries with debug information set the C\u005c+M\u005c+A\u005c+K\u005c+E\u005c+\u005c_\u005c+\u005c+B\u005c+U\u005c+I\u005c+L\u005c+D\u005c+\u005c_\u005c+\u005c+T\u005c+Y\u005c+PE flag to D\u005c+E\u005c+B\u005c+UG\u005c+: \n\u005cbegin{DoxyCode}\n1 $ cmake -G \u0022MSYS Makefiles\u0022 -DCMAKE\u005c_INSTALL\u005c_PREFIX\u003dC:/MinGW -DCMAKE\u005c_BUILD\u005c_TYPE\u003dDEBUG ..\n\u005cend{DoxyCode}\n\n\u005citem Finally you can build using the generated Makefile and get the results deployed into your Min\u005c+GW installation\u005c+:\n\u005cend{DoxyEnumerate}\n\n\n\u005cbegin{DoxyCode}\n1 $ make\n2 $ make install\n\u005cend{DoxyCode}\n\n\n\u005csubsection*{Setting compile options }\n\nTo set compile time flags you can either use one of the C\u005c+Make gui applications or do it via command line.\n\n\u005csubsection*{Command line }\n\nTo list avaialable options (ommit the H if you don\u005ctextquotesingle{}t want the help text)\u005c+: \u005cbegin{DoxyVerb} cmake -LH ..\n\u005cend{DoxyVerb}\n\n\nThen to set an option and build (for example turn off S\u005c+SL support)\u005c+: \u005cbegin{DoxyVerb} cmake -DLWS_WITH_SSL\u003d0 ..\n\u005cend{DoxyVerb}\n or cmake -\u005c/\u005c+D\u005c+L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+I\u005c+T\u005c+H\u005c+\u005c_\u005c+\u005c+S\u005c+SL\u005c+:B\u005c+O\u005c+OL\u003dO\u005c+FF ..\n\n\u005csubsection*{Building on mbed3 }\n\nM\u005c+B\u005c+E\u005c+D3 is a non-\u005c/posix embedded OS targeted on Cortex M class chips.\n\n\u005chref{https://www.mbed.com/}{\u005ctt https\u005c+://www.\u005c+mbed.\u005c+com/}\n\nIt\u005ctextquotesingle{}s quite unlike any other Posixy platform since the OS is linked statically in with lws to form one binary.\n\nAt the minute server-\u005c/only is supported and due to bugs in mbed3 network support, the port is of alpha quality. However it can serve the test html, favicon.\u005c+ico and logo png and may be able to make ws connections. The binary for that including the OS, test app, lws and all the assets is only 117\u005c+KB.\n\n0) Today mbed3 only properly works on F\u005c+R\u005c+DM K64F \u005c$35 Freescale Dev Board with 1\u005c+MB Flash, 256\u005c+KB S\u005c+R\u005c+AM and Ethernet.\n\n\u005chref{http://www.freescale.com/products/arm-processors/kinetis-cortex-m/k-series/k6x-ethernet-mcus/freescale-freedom-development-platform-for-kinetis-k64-k63-and-k24-mcus:FRDM-K64F}{\u005ctt http\u005c+://www.\u005c+freescale.\u005c+com/products/arm-\u005c/processors/kinetis-\u005c/cortex-\u005c/m/k-\u005c/series/k6x-\u005c/ethernet-\u005c/mcus/freescale-\u005c/freedom-\u005c/development-\u005c/platform-\u005c/for-\u005c/kinetis-\u005c/k64-\u005c/k63-\u005c/and-\u005c/k24-\u005c/mcus\u005c+:\u005c+F\u005c+R\u005c+D\u005c+M-\u005c/\u005c+K64F}\n\n1) Get a working mbed3 environment with arm-\u005c/none-\u005c/eabi-\u005c/cs toolchain (available in Fedora, Ubuntu and other distros)\n\n2) Confirm you can build things using yotta by following the getting started guide here\n\n\u005chref{https://docs.mbed.com/docs/getting-started-mbed-os/en/latest/}{\u005ctt https\u005c+://docs.\u005c+mbed.\u005c+com/docs/getting-\u005c/started-\u005c/mbed-\u005c/os/en/latest/}\n\n3)\n\ngit clone \u005chref{https://github.com/warmcat/lws-test-server}{\u005ctt https\u005c+://github.\u005c+com/warmcat/lws-\u005c/test-\u005c/server}\n\nand cd into it\n\n4) mkdir -\u005c/p yotta\u005c+\u005c_\u005c+modules ; cd yotta\u005c+\u005c_\u005c+modules\n\n5) git clone \u005chref{https://github.com/warmcat/libwebsockets}{\u005ctt https\u005c+://github.\u005c+com/warmcat/libwebsockets} ; mv libwebsockets websockets ; cd ..\n\n6) yotta target frdm-\u005c/k64f-\u005c/gcc\n\n7) yotta install\n\n8) yotta build\n\n\u005csubsection*{Unix G\u005c+UI }\n\nIf you have a curses-\u005c/enabled build you simply type\u005c+: (not all packages include this, my debian install does not for example). \u005cbegin{DoxyVerb} ccmake\n\u005cend{DoxyVerb}\n\n\n\u005csubsection*{Windows G\u005c+UI }\n\nOn windows C\u005c+Make comes with a gui application\u005c+: Start -\u005c/$\u003e$ Programs -\u005c/$\u003e$ C\u005c+Make -\u005c/$\u003e$ C\u005c+Make (cmake-\u005c/gui)\n\n\u005csubsection*{wolf\u005c+S\u005c+S\u005c+L/\u005c+Cya\u005c+S\u005c+SL replacement for Open\u005c+S\u005c+SL }\n\nwolf\u005c+S\u005c+S\u005c+L/\u005c+Cya\u005c+S\u005c+SL is a lightweight S\u005c+SL library targeted at embedded systems\u005c+: \u005chref{https://www.wolfssl.com/wolfSSL/Products-wolfssl.html}{\u005ctt https\u005c+://www.\u005c+wolfssl.\u005c+com/wolf\u005c+S\u005c+S\u005c+L/\u005c+Products-\u005c/wolfssl.\u005c+html}\n\nIt contains a Open\u005c+S\u005c+SL compatibility layer which makes it possible to pretty much link to it instead of Open\u005c+S\u005c+SL, giving a much smaller footprint.\n\n{\u005cbfseries N\u005c+O\u005c+TE}\u005c+: wolfssl needs to be compiled using the {\u005cttfamily -\u005c/-\u005c/enable-\u005c/opensslextra} flag for this to work.\n\n\u005csubsection*{Compiling libwebsockets with wolf\u005c+S\u005c+SL }\n\n\n\u005cbegin{DoxyCode}\n1 cmake .. -DLWS\u005c_USE\u005c_WOLFSSL\u003d1 \u005c(\u005cbackslash\u005c)\n2 -DLWS\u005c_WOLFSSL\u005c_INCLUDE\u005c_DIRS\u003d/path/to/wolfssl \u005c(\u005cbackslash\u005c)\n3 -DLWS\u005c_WOLFSSL\u005c_LIBRARIES\u003d/path/to/wolfssl/wolfssl.a ..\n\u005cend{DoxyCode}\n\n\n{\u005cbfseries N\u005c+O\u005c+TE}\u005c+: On windows use the .lib file extension for {\u005cttfamily L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+O\u005c+L\u005c+F\u005c+S\u005c+S\u005c+L\u005c+\u005c_\u005c+\u005c+L\u005c+I\u005c+B\u005c+R\u005c+A\u005c+R\u005c+I\u005c+ES} instead.\n\n\u005csubsection*{Compiling libwebsockets with Cya\u005c+S\u005c+SL }\n\n\n\u005cbegin{DoxyCode}\n1 cmake .. -DLWS\u005c_USE\u005c_CYASSL\u003d1 \u005c(\u005cbackslash\u005c)\n2 -DLWS\u005c_CYASSL\u005c_INCLUDE\u005c_DIRS\u003d/path/to/cyassl \u005c(\u005cbackslash\u005c)\n3 -DLWS\u005c_CYASSL\u005c_LIBRARIES\u003d/path/to/wolfssl/cyassl.a ..\n\u005cend{DoxyCode}\n\n\n{\u005cbfseries N\u005c+O\u005c+TE}\u005c+: On windows use the .lib file extension for {\u005cttfamily L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+C\u005c+Y\u005c+A\u005c+S\u005c+S\u005c+L\u005c+\u005c_\u005c+\u005c+L\u005c+I\u005c+B\u005c+R\u005c+A\u005c+R\u005c+I\u005c+ES} instead.\n\n\u005csubsection*{Compiling libwebsockets with Polar\u005c+S\u005c+SL }\n\nCaution... at some point Polar\u005c+S\u005c+SL became Mbed\u005c+T\u005c+LS. But it did not happen all at once. The name changed first then at mbed\u005c+T\u005c+LS 2.\u005c+0 the apis changed. So eg in Fedora 22, there is an \u005cchar`\u005c\u0022{}mbedtls\u005cchar`\u005c\u0022{} package which is actually using polarssl for the include dir and polarssl apis... this should be treated as polarssl then.\n\nExample config for this case is \n\u005cbegin{DoxyCode}\n1 cmake .. -DLWS\u005c_USE\u005c_POLARSSL\u003d1 -DLWS\u005c_POLARSSL\u005c_LIBRARIES\u003d/usr/lib64/libmbedtls.so \u005c(\u005cbackslash\u005c)\n2 -DLWS\u005c_POLARSSL\u005c_INCLUDE\u005c_DIRS\u003d/usr/include/polarssl/\n\u005cend{DoxyCode}\n\n\n\u005csubsection*{Building plugins outside of lws itself }\n\nThe directory ./plugin-\u005c/standalone/ shows how easy it is to create plugins outside of lws itself. First build lws itself with -\u005c/\u005c+D\u005c+L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+I\u005c+T\u005c+H\u005c+\u005c_\u005c+\u005c+P\u005c+L\u005c+U\u005c+G\u005c+I\u005c+NS, then use the same flow to build the standalone plugin \n\u005cbegin{DoxyCode}\n1 cd ./plugin-standalone\n2 mkdir build\n3 cd build\n4 cmake ..\n5 make \u0026\u0026 sudo make install\n\u005cend{DoxyCode}\n\n\nif you changed the default plugin directory when you built lws, you must also give the same arguments to cmake here (eg, {\u005cttfamily -\u005c/\u005c+D\u005c+C\u005c+M\u005c+A\u005c+K\u005c+E\u005c+\u005c_\u005c+\u005c+I\u005c+N\u005c+S\u005c+T\u005c+A\u005c+L\u005c+L\u005c+\u005c_\u005c+\u005c+P\u005c+R\u005c+E\u005c+F\u005c+IX\u005c+:P\u005c+A\u005c+TH\u003d/usr/something/else...} )\n\nOtherwise if you run lwsws or libwebsockets-\u005c/test-\u005c/server-\u005c/v2.\u005c+0, it will now find the additional plugin \u005cchar`\u005c\u0022{}libprotocol\u005c+\u005c_\u005c+example\u005c+\u005c_\u005c+standalone.\u005c+so\u005cchar`\u005c\u0022{} \n\u005cbegin{DoxyCode}\n1 lwsts[21257]: Plugins:\n2 lwsts[21257]: libprotocol\u005c_dumb\u005c_increment.so\n3 lwsts[21257]: libprotocol\u005c_example\u005c_standalone.so\n4 lwsts[21257]: libprotocol\u005c_lws\u005c_mirror.so\n5 lwsts[21257]: libprotocol\u005c_lws\u005c_server\u005c_status.so\n6 lwsts[21257]: libprotocol\u005c_lws\u005c_status.so\n\u005cend{DoxyCode}\n If you have multiple vhosts, you must enable plugins at the vhost additionally, discovered plugins are not enabled automatically for security reasons. You do this using info-\u005c/$\u003e$pvo or for lwsws, in the J\u005c+S\u005c+ON config.\n\n\u005csubsection*{Reproducing H\u005c+T\u005c+T\u005c+P2.\u005c+0 tests }\n\nYou must have built and be running lws against a version of openssl that has A\u005c+L\u005c+PN / N\u005c+PN. Most distros still have older versions. You\u005ctextquotesingle{}ll know it\u005ctextquotesingle{}s right by seeing \n\u005cbegin{DoxyCode}\n1 lwsts[4752]: Compiled with OpenSSL support\n2 lwsts[4752]: Using SSL mode\n3 lwsts[4752]: HTTP2 / ALPN enabled\n\u005cend{DoxyCode}\n at lws startup.\n\nFor non-\u005c/\u005c+S\u005c+SL H\u005c+T\u005c+T\u005c+P2.\u005c+0 upgrade \n\u005cbegin{DoxyCode}\n1 $ nghttp -nvasu http://localhost:7681/test.htm\n\u005cend{DoxyCode}\n For S\u005c+SL / A\u005c+L\u005c+PN H\u005c+T\u005c+T\u005c+P2.\u005c+0 upgrade \n\u005cbegin{DoxyCode}\n1 $ nghttp -nvas https://localhost:7681/test.html\n\u005cend{DoxyCode}\n\n\n\u005csubsection*{Cross compiling }\n\nTo enable cross-\u005c/compiling {\u005cbfseries libwebsockets} using C\u005c+Make you need to create a \u005cchar`\u005c\u0022{}\u005c+Toolchain file\u005cchar`\u005c\u0022{} that you supply to C\u005c+Make when generating your build files. C\u005c+Make will then use the cross compilers and build paths specified in this file to look for dependencies and such.\n\n{\u005cbfseries Libwebsockets} includes an example toolchain file \u005chref{cross-arm-linux-gnueabihf.cmake}{\u005ctt cross-\u005c/arm-\u005c/linux-\u005c/gnueabihf.\u005c+cmake} you can use as a starting point.\n\nThe commandline to configure for cross with this would look like \n\u005cbegin{DoxyCode}\n1 $ cmake .. -DCMAKE\u005c_INSTALL\u005c_PREFIX:PATH\u003d/usr \u005c(\u005cbackslash\u005c)\n2 -DCMAKE\u005c_TOOLCHAIN\u005c_FILE\u003d../cross-arm-linux-gnueabihf.cmake \u005c(\u005cbackslash\u005c)\n3 -DWITHOUT\u005c_EXTENSIONS\u003d1 -DWITH\u005c_SSL\u003d0\n\u005cend{DoxyCode}\n The example shows how to build with no external cross lib dependencies, you need to provide the cross libraries otherwise.\n\n{\u005cbfseries N\u005c+O\u005c+TE}\u005c+: start from an E\u005c+M\u005c+P\u005c+TY build directory if you had a non-\u005c/cross build in there before the settings will be cached and your changes ignored.\n\nAdditional information on cross compilation with C\u005c+Make\u005c+: \u005chref{http://www.vtk.org/Wiki/CMake_Cross_Compiling}{\u005ctt http\u005c+://www.\u005c+vtk.\u005c+org/\u005c+Wiki/\u005c+C\u005c+Make\u005c+\u005c_\u005c+\u005c+Cross\u005c+\u005c_\u005c+\u005c+Compiling}\n\n\u005csubsection*{Memory efficiency }\n\nEmbedded server-\u005c/only configuration without extensions (ie, no compression on websocket connections), but with full v13 websocket features and http server, built on A\u005c+RM Cortex-\u005c/\u005c+A9\u005c+:\n\nUpdate at 8dac94d (2013-\u005c/02-\u005c/18) \n\u005cbegin{DoxyCode}\n1 $ ./configure --without-client --without-extensions --disable-debug --without-daemonize\n2 \n3 Context Creation, 1024 fd limit[2]: 16720 (includes 12 bytes per fd)\n4 Per-connection [3]: 72 bytes, +1328 during headers\n5 \n6 .text .rodata .data .bss\n7 11512 2784 288 4\n\u005cend{DoxyCode}\n This shows the impact of the major configuration with/without options at 13ba5bbc633ea962d46d using Ubuntu A\u005c+RM on a Panda\u005c+Board ES.\n\nThese are accounting for static allocations from the library elf, there are additional dynamic allocations via malloc. These are a bit old now but give the right idea for relative \u005cchar`\u005c\u0022{}expense\u005cchar`\u005c\u0022{} of features.\n\nStatic allocations, A\u005c+R\u005c+M9\n\n\u005ctabulinesep\u003d1mm\n\u005cbegin{longtabu} spread 0pt [c]{*5{|X[-1]}|}\n\u005chline\n\u005crowcolor{\u005ctableheadbgcolor}{\u005cbf }\u0026{\u005cbf .text }\u0026{\u005cbf .rodata }\u0026{\u005cbf .data }\u0026{\u005cbf .bss }\u005c\u005c\u005ccline{1-5}\n\u005cendfirsthead\n\u005chline\n\u005cendfoot\n\u005chline\n\u005crowcolor{\u005ctableheadbgcolor}{\u005cbf }\u0026{\u005cbf .text }\u0026{\u005cbf .rodata }\u0026{\u005cbf .data }\u0026{\u005cbf .bss }\u005c\u005c\u005ccline{1-5}\n\u005cendhead\nAll (no without) \u002635024 \u00269940 \u0026336 \u00264104 \u005c\u005c\u005ccline{1-5}\nwithout client \u002625684 \u00267144 \u0026336 \u00264104 \u005c\u005c\u005ccline{1-5}\nwithout client, exts \u002621652 \u00266288 \u0026288 \u00264104 \u005c\u005c\u005ccline{1-5}\nwithout client, exts, debug\u005cmbox{[}1\u005cmbox{]} \u002619756 \u00263768 \u0026288 \u00264104 \u005c\u005c\u005ccline{1-5}\nwithout server \u002630304 \u00268160 \u0026336 \u00264104 \u005c\u005c\u005ccline{1-5}\nwithout server, exts \u002625382 \u00267204 \u0026288 \u00264104 \u005c\u005c\u005ccline{1-5}\nwithout server, exts, debug\u005cmbox{[}1\u005cmbox{]} \u002623712 \u00264256 \u0026288 \u00264104 \u005c\u005c\u005ccline{1-5}\n\u005cend{longtabu}\n\u005cmbox{[}1\u005cmbox{]} {\u005cttfamily -\u005c/-\u005c/disable-\u005c/debug} only removes messages below {\u005cttfamily lwsl\u005c+\u005c_\u005c+notice}. Since that is the default logging level the impact is not noticeable, error, warn and notice logs are all still there.\n\n\u005cmbox{[}2\u005cmbox{]} {\u005cttfamily 1024} fd per process is the default limit (set by ulimit) in at least Fedora and Ubuntu. You can make significant savings tailoring this to actual expected peak fds, ie, at a limit of {\u005cttfamily 20}, context creation allocation reduces to {\u005cttfamily 4432 + 240 \u003d 4672})\n\n\u005cmbox{[}3\u005cmbox{]} known header content is freed after connection establishment ","s":{"c":1758941945,"u": 1850}}
],"g": 2760,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "7d0a"}