From 014481e9126de0fa30adbe7d871f238311b8e3c6 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 20 Jun 2016 17:05:31 +0800 Subject: [PATCH] documentation convert to doxygen Signed-off-by: Andy Green --- CMakeLists.txt | 16 - README.build.md | 257 +- README.coding.md | 220 +- README.generic-sessions.md | 222 +- README.lwsws.md | 381 +- README.md | 5 +- README.test-apps.md | 157 +- doc/html/annotated.html | 118 + doc/html/annotated_dup.js | 30 + doc/html/arrowdown.png | Bin 0 -> 246 bytes doc/html/arrowright.png | Bin 0 -> 229 bytes doc/html/bc_s.png | Bin 0 -> 676 bytes doc/html/bdwn.png | Bin 0 -> 147 bytes doc/html/classes.html | 101 + doc/html/classlws__conn.html | 143 + doc/html/classlws__conn.js | 15 + doc/html/classlws__conn.png | Bin 0 -> 480 bytes doc/html/classlws__conn__listener.html | 265 + doc/html/classlws__conn__listener.js | 10 + doc/html/classlws__conn__listener.png | Bin 0 -> 477 bytes doc/html/closed.png | Bin 0 -> 132 bytes doc/html/deprecated.html | 87 + .../dir_97aefd0d527b934f1d99a682da8fe6a9.html | 92 + .../dir_97aefd0d527b934f1d99a682da8fe6a9.js | 4 + doc/html/doc.png | Bin 0 -> 746 bytes doc/html/doxygen.css | 1475 ++++++ doc/html/doxygen.png | Bin 0 -> 3779 bytes doc/html/dynsections.js | 97 + doc/html/files.html | 91 + doc/html/files.js | 4 + doc/html/folderclosed.png | Bin 0 -> 616 bytes doc/html/folderopen.png | Bin 0 -> 597 bytes doc/html/functions.html | 654 +++ doc/html/functions_func.html | 107 + doc/html/functions_vars.html | 641 +++ doc/html/globals.html | 109 + doc/html/globals_dup.js | 5 + doc/html/globals_enum.html | 122 + doc/html/globals_eval.html | 419 ++ doc/html/globals_func.html | 423 ++ doc/html/globals_l.html | 769 +++ doc/html/globals_type.html | 101 + doc/html/group__HTTP-headers-create.html | 377 ++ doc/html/group__HTTP-headers-create.js | 8 + doc/html/group__HTTP-headers-read.html | 499 ++ doc/html/group__HTTP-headers-read.js | 16 + doc/html/group__Protocols-and-Plugins.html | 316 ++ doc/html/group__Protocols-and-Plugins.js | 32 + doc/html/group__callback-when-writeable.html | 426 ++ doc/html/group__callback-when-writeable.js | 11 + doc/html/group__cgi.html | 82 + doc/html/group__client.html | 353 ++ doc/html/group__client.js | 26 + doc/html/group__context-and-vhost.html | 657 +++ doc/html/group__context-and-vhost.js | 81 + doc/html/group__ev.html | 104 + doc/html/group__extensions.html | 449 ++ doc/html/group__extensions.js | 27 + doc/html/group__fops.html | 124 + doc/html/group__fops.js | 11 + doc/html/group__form-parsing.html | 408 ++ doc/html/group__form-parsing.js | 15 + doc/html/group__generic-sessions.html | 169 + doc/html/group__generic-sessions.js | 31 + .../group__html-chunked-substitution.html | 185 + doc/html/group__html-chunked-substitution.js | 19 + doc/html/group__http.html | 249 + doc/html/group__http.js | 16 + doc/html/group__httpft.html | 157 + doc/html/group__httpft.js | 4 + doc/html/group__log.html | 278 + doc/html/group__log.js | 7 + doc/html/group__misc.html | 432 ++ doc/html/group__misc.js | 14 + doc/html/group__net.html | 284 + doc/html/group__net.js | 7 + doc/html/group__pur.html | 181 + doc/html/group__pur.js | 5 + doc/html/group__sending-data.html | 226 + doc/html/group__sending-data.js | 13 + doc/html/group__service.html | 328 ++ doc/html/group__service.js | 9 + doc/html/group__sha.html | 234 + doc/html/group__sha.js | 6 + doc/html/group__smtp.html | 280 + doc/html/group__smtp.js | 36 + doc/html/group__sock-adopt.html | 190 + doc/html/group__sock-adopt.js | 5 + doc/html/group__timeout.html | 161 + doc/html/group__timeout.js | 4 + doc/html/group__urlendec.html | 182 + doc/html/group__urlendec.js | 5 + doc/html/group__usercb.html | 392 ++ doc/html/group__usercb.js | 46 + doc/html/group__uv.html | 106 + doc/html/group__vhost-mounts.html | 153 + doc/html/group__vhost-mounts.js | 36 + doc/html/group__wsclose.html | 238 + doc/html/group__wsclose.js | 19 + doc/html/group__wsstatus.html | 279 + doc/html/group__wsstatus.js | 10 + doc/html/hierarchy.html | 118 + doc/html/hierarchy.js | 31 + doc/html/index.html | 90 + doc/html/jquery.js | 68 + doc/html/libwebsockets.org-logo.png | Bin 0 -> 7029 bytes doc/html/libwebsockets_8h.html | 1092 ++++ doc/html/libwebsockets_8h.js | 493 ++ doc/html/libwebsockets_8h_source.html | 481 ++ doc/html/md_README.build.html | 216 + doc/html/md_README.coding.html | 224 + doc/html/md_README.generic-sessions.html | 171 + doc/html/md_README.lwsws.html | 164 + doc/html/md_README.test-apps.html | 157 + doc/html/modules.html | 114 + doc/html/modules.js | 26 + doc/html/nav_f.png | Bin 0 -> 153 bytes doc/html/nav_g.png | Bin 0 -> 95 bytes doc/html/nav_h.png | Bin 0 -> 98 bytes doc/html/navtree.css | 143 + doc/html/navtree.js | 523 ++ doc/html/navtreedata.js | 44 + doc/html/navtreeindex0.js | 253 + doc/html/navtreeindex1.js | 253 + doc/html/navtreeindex2.js | 253 + doc/html/navtreeindex3.js | 215 + doc/html/open.png | Bin 0 -> 123 bytes doc/html/pages.html | 89 + doc/html/resize.js | 97 + doc/html/splitbar.png | Bin 0 -> 314 bytes doc/html/structlws__cgi__args.html | 173 + doc/html/structlws__cgi__args.js | 8 + .../structlws__client__connect__info.html | 357 ++ doc/html/structlws__client__connect__info.js | 20 + .../structlws__context__creation__info.html | 689 +++ .../structlws__context__creation__info.js | 42 + doc/html/structlws__email.html | 357 ++ doc/html/structlws__email.js | 20 + doc/html/structlws__ext__option__arg.html | 162 + doc/html/structlws__ext__option__arg.js | 7 + doc/html/structlws__ext__options.html | 132 + doc/html/structlws__ext__options.js | 5 + doc/html/structlws__extension.html | 147 + doc/html/structlws__extension.js | 6 + doc/html/structlws__gs__event__args.html | 147 + doc/html/structlws__gs__event__args.js | 6 + doc/html/structlws__http__mount.html | 343 ++ doc/html/structlws__http__mount.js | 19 + doc/html/structlws__plat__file__ops.html | 178 + doc/html/structlws__plat__file__ops.js | 8 + doc/html/structlws__plugin.html | 177 + doc/html/structlws__plugin.js | 8 + doc/html/structlws__plugin__capability.html | 177 + doc/html/structlws__plugin__capability.js | 8 + doc/html/structlws__polarssl__context.html | 143 + doc/html/structlws__polarssl__context.js | 6 + doc/html/structlws__pollargs.html | 147 + doc/html/structlws__pollargs.js | 6 + doc/html/structlws__pollfd.html | 143 + doc/html/structlws__pollfd.js | 6 + doc/html/structlws__process__html__args.html | 158 + doc/html/structlws__process__html__args.js | 7 + doc/html/structlws__process__html__state.html | 203 + doc/html/structlws__process__html__state.js | 10 + .../structlws__protocol__vhost__options.html | 163 + .../structlws__protocol__vhost__options.js | 7 + doc/html/structlws__protocols.html | 193 + doc/html/structlws__protocols.js | 9 + doc/html/structlws__session__info.html | 177 + doc/html/structlws__session__info.js | 8 + doc/html/structlws__token__limits.html | 113 + doc/html/structlws__token__limits.js | 4 + doc/html/structlws__tokens.html | 132 + doc/html/structlws__tokens.js | 5 + doc/html/structlwsgw__hash.html | 117 + doc/html/structlwsgw__hash.js | 4 + doc/html/structlwsgw__hash__bin.html | 117 + doc/html/structlwsgw__hash__bin.js | 4 + doc/html/structpollfd.html | 143 + doc/html/structpollfd.js | 6 + doc/html/sync_off.png | Bin 0 -> 853 bytes doc/html/sync_on.png | Bin 0 -> 845 bytes doc/html/tab_a.png | Bin 0 -> 142 bytes doc/html/tab_b.png | Bin 0 -> 169 bytes doc/html/tab_h.png | Bin 0 -> 177 bytes doc/html/tab_s.png | Bin 0 -> 184 bytes doc/html/tabs.css | 60 + doc/latex/annotated.tex | 30 + doc/latex/classlws__conn.eps | 197 + doc/latex/classlws__conn.pdf | Bin 0 -> 4714 bytes doc/latex/classlws__conn.tex | 52 + doc/latex/classlws__conn__listener.eps | 197 + doc/latex/classlws__conn__listener.pdf | Bin 0 -> 4714 bytes doc/latex/classlws__conn__listener.tex | 75 + doc/latex/deprecated.tex | 12 + .../dir_97aefd0d527b934f1d99a682da8fe6a9.tex | 7 + doc/latex/doxygen.sty | 477 ++ doc/latex/files.tex | 4 + doc/latex/group__HTTP-headers-create.tex | 172 + doc/latex/group__HTTP-headers-read.tex | 310 ++ doc/latex/group__Protocols-and-Plugins.tex | 164 + doc/latex/group__callback-when-writeable.tex | 244 + doc/latex/group__cgi.tex | 7 + doc/latex/group__client.tex | 167 + doc/latex/group__context-and-vhost.tex | 422 ++ doc/latex/group__ev.tex | 26 + doc/latex/group__extensions.tex | 283 + doc/latex/group__fops.tex | 42 + doc/latex/group__form-parsing.tex | 237 + doc/latex/group__generic-sessions.tex | 86 + .../group__html-chunked-substitution.tex | 90 + doc/latex/group__http.tex | 113 + doc/latex/group__httpft.tex | 53 + doc/latex/group__log.tex | 135 + doc/latex/group__misc.tex | 239 + doc/latex/group__net.tex | 128 + doc/latex/group__pur.tex | 66 + doc/latex/group__sending-data.tex | 148 + doc/latex/group__service.tex | 171 + doc/latex/group__sha.tex | 95 + doc/latex/group__smtp.tex | 166 + doc/latex/group__sock-adopt.tex | 77 + doc/latex/group__timeout.tex | 65 + doc/latex/group__urlendec.tex | 68 + doc/latex/group__usercb.tex | 312 ++ doc/latex/group__uv.tex | 29 + doc/latex/group__vhost-mounts.tex | 67 + doc/latex/group__wsclose.tex | 133 + doc/latex/group__wsstatus.tex | 149 + doc/latex/hierarchy.tex | 32 + doc/latex/index.tex | 14 + doc/latex/libwebsockets_8h.tex | 889 ++++ doc/latex/md_README.build.tex | 392 ++ doc/latex/md_README.coding.tex | 458 ++ doc/latex/md_README.generic-sessions.tex | 329 ++ doc/latex/md_README.lwsws.tex | 390 ++ doc/latex/md_README.test-apps.tex | 245 + doc/latex/modules.tex | 40 + doc/latex/refman.tex | 246 + doc/latex/structlws__cgi__args.tex | 38 + .../structlws__client__connect__info.tex | 105 + .../structlws__context__creation__info.tex | 219 + doc/latex/structlws__email.tex | 105 + doc/latex/structlws__ext__option__arg.tex | 40 + doc/latex/structlws__ext__options.tex | 30 + doc/latex/structlws__extension.tex | 35 + doc/latex/structlws__gs__event__args.tex | 35 + doc/latex/structlws__http__mount.tex | 102 + doc/latex/structlws__plat__file__ops.tex | 47 + doc/latex/structlws__plugin.tex | 45 + doc/latex/structlws__plugin__capability.tex | 45 + doc/latex/structlws__polarssl__context.tex | 28 + doc/latex/structlws__pollargs.tex | 35 + doc/latex/structlws__pollfd.tex | 28 + doc/latex/structlws__process__html__args.tex | 33 + doc/latex/structlws__process__html__state.tex | 48 + .../structlws__protocol__vhost__options.tex | 42 + doc/latex/structlws__protocols.tex | 52 + doc/latex/structlws__session__info.tex | 45 + doc/latex/structlws__token__limits.tex | 18 + doc/latex/structlws__tokens.tex | 30 + doc/latex/structlwsgw__hash.tex | 25 + doc/latex/structlwsgw__hash__bin.tex | 25 + doc/latex/structpollfd.tex | 28 + lib/client-handshake.c | 50 - lib/client.c | 9 - lib/context.c | 62 - lib/extension.c | 9 - lib/header.c | 9 - lib/lejp.c | 22 +- lib/lejp.h | 4 +- lib/libwebsockets.c | 288 +- lib/libwebsockets.h | 4615 +++++++++++------ lib/lws-plat-mbed3.c | 2 +- lib/lws-plat-unix.c | 15 - lib/lws-plat-win.c | 21 +- lib/output.c | 28 - lib/parsers.c | 73 - lib/pollfd.c | 35 - lib/server.c | 126 - lib/service.c | 55 - lib/smtp.c | 27 - libwebsockets-api-doc.html | 2326 --------- libwebsockets.dox | 317 ++ mainpage.md | 13 + scripts/kernel-doc | 2239 -------- win32port/zlib/adler32.c | 2 +- win32port/zlib/compress.c | 2 +- win32port/zlib/crc32.c | 2 +- win32port/zlib/deflate.c | 2 +- win32port/zlib/deflate.h | 2 +- win32port/zlib/gzio.c | 2 +- win32port/zlib/trees.c | 2 +- win32port/zlib/uncompr.c | 2 +- win32port/zlib/zconf.h | 2 +- win32port/zlib/zutil.c | 2 +- win32port/zlib/zutil.h | 2 +- 297 files changed, 39301 insertions(+), 7659 deletions(-) create mode 100644 doc/html/annotated.html create mode 100644 doc/html/annotated_dup.js create mode 100644 doc/html/arrowdown.png create mode 100644 doc/html/arrowright.png create mode 100644 doc/html/bc_s.png create mode 100644 doc/html/bdwn.png create mode 100644 doc/html/classes.html create mode 100644 doc/html/classlws__conn.html create mode 100644 doc/html/classlws__conn.js create mode 100644 doc/html/classlws__conn.png create mode 100644 doc/html/classlws__conn__listener.html create mode 100644 doc/html/classlws__conn__listener.js create mode 100644 doc/html/classlws__conn__listener.png create mode 100644 doc/html/closed.png create mode 100644 doc/html/deprecated.html create mode 100644 doc/html/dir_97aefd0d527b934f1d99a682da8fe6a9.html create mode 100644 doc/html/dir_97aefd0d527b934f1d99a682da8fe6a9.js create mode 100644 doc/html/doc.png create mode 100644 doc/html/doxygen.css create mode 100644 doc/html/doxygen.png create mode 100644 doc/html/dynsections.js create mode 100644 doc/html/files.html create mode 100644 doc/html/files.js create mode 100644 doc/html/folderclosed.png create mode 100644 doc/html/folderopen.png create mode 100644 doc/html/functions.html create mode 100644 doc/html/functions_func.html create mode 100644 doc/html/functions_vars.html create mode 100644 doc/html/globals.html create mode 100644 doc/html/globals_dup.js create mode 100644 doc/html/globals_enum.html create mode 100644 doc/html/globals_eval.html create mode 100644 doc/html/globals_func.html create mode 100644 doc/html/globals_l.html create mode 100644 doc/html/globals_type.html create mode 100644 doc/html/group__HTTP-headers-create.html create mode 100644 doc/html/group__HTTP-headers-create.js create mode 100644 doc/html/group__HTTP-headers-read.html create mode 100644 doc/html/group__HTTP-headers-read.js create mode 100644 doc/html/group__Protocols-and-Plugins.html create mode 100644 doc/html/group__Protocols-and-Plugins.js create mode 100644 doc/html/group__callback-when-writeable.html create mode 100644 doc/html/group__callback-when-writeable.js create mode 100644 doc/html/group__cgi.html create mode 100644 doc/html/group__client.html create mode 100644 doc/html/group__client.js create mode 100644 doc/html/group__context-and-vhost.html create mode 100644 doc/html/group__context-and-vhost.js create mode 100644 doc/html/group__ev.html create mode 100644 doc/html/group__extensions.html create mode 100644 doc/html/group__extensions.js create mode 100644 doc/html/group__fops.html create mode 100644 doc/html/group__fops.js create mode 100644 doc/html/group__form-parsing.html create mode 100644 doc/html/group__form-parsing.js create mode 100644 doc/html/group__generic-sessions.html create mode 100644 doc/html/group__generic-sessions.js create mode 100644 doc/html/group__html-chunked-substitution.html create mode 100644 doc/html/group__html-chunked-substitution.js create mode 100644 doc/html/group__http.html create mode 100644 doc/html/group__http.js create mode 100644 doc/html/group__httpft.html create mode 100644 doc/html/group__httpft.js create mode 100644 doc/html/group__log.html create mode 100644 doc/html/group__log.js create mode 100644 doc/html/group__misc.html create mode 100644 doc/html/group__misc.js create mode 100644 doc/html/group__net.html create mode 100644 doc/html/group__net.js create mode 100644 doc/html/group__pur.html create mode 100644 doc/html/group__pur.js create mode 100644 doc/html/group__sending-data.html create mode 100644 doc/html/group__sending-data.js create mode 100644 doc/html/group__service.html create mode 100644 doc/html/group__service.js create mode 100644 doc/html/group__sha.html create mode 100644 doc/html/group__sha.js create mode 100644 doc/html/group__smtp.html create mode 100644 doc/html/group__smtp.js create mode 100644 doc/html/group__sock-adopt.html create mode 100644 doc/html/group__sock-adopt.js create mode 100644 doc/html/group__timeout.html create mode 100644 doc/html/group__timeout.js create mode 100644 doc/html/group__urlendec.html create mode 100644 doc/html/group__urlendec.js create mode 100644 doc/html/group__usercb.html create mode 100644 doc/html/group__usercb.js create mode 100644 doc/html/group__uv.html create mode 100644 doc/html/group__vhost-mounts.html create mode 100644 doc/html/group__vhost-mounts.js create mode 100644 doc/html/group__wsclose.html create mode 100644 doc/html/group__wsclose.js create mode 100644 doc/html/group__wsstatus.html create mode 100644 doc/html/group__wsstatus.js create mode 100644 doc/html/hierarchy.html create mode 100644 doc/html/hierarchy.js create mode 100644 doc/html/index.html create mode 100644 doc/html/jquery.js create mode 100644 doc/html/libwebsockets.org-logo.png create mode 100644 doc/html/libwebsockets_8h.html create mode 100644 doc/html/libwebsockets_8h.js create mode 100644 doc/html/libwebsockets_8h_source.html create mode 100644 doc/html/md_README.build.html create mode 100644 doc/html/md_README.coding.html create mode 100644 doc/html/md_README.generic-sessions.html create mode 100644 doc/html/md_README.lwsws.html create mode 100644 doc/html/md_README.test-apps.html create mode 100644 doc/html/modules.html create mode 100644 doc/html/modules.js create mode 100644 doc/html/nav_f.png create mode 100644 doc/html/nav_g.png create mode 100644 doc/html/nav_h.png create mode 100644 doc/html/navtree.css create mode 100644 doc/html/navtree.js create mode 100644 doc/html/navtreedata.js create mode 100644 doc/html/navtreeindex0.js create mode 100644 doc/html/navtreeindex1.js create mode 100644 doc/html/navtreeindex2.js create mode 100644 doc/html/navtreeindex3.js create mode 100644 doc/html/open.png create mode 100644 doc/html/pages.html create mode 100644 doc/html/resize.js create mode 100644 doc/html/splitbar.png create mode 100644 doc/html/structlws__cgi__args.html create mode 100644 doc/html/structlws__cgi__args.js create mode 100644 doc/html/structlws__client__connect__info.html create mode 100644 doc/html/structlws__client__connect__info.js create mode 100644 doc/html/structlws__context__creation__info.html create mode 100644 doc/html/structlws__context__creation__info.js create mode 100644 doc/html/structlws__email.html create mode 100644 doc/html/structlws__email.js create mode 100644 doc/html/structlws__ext__option__arg.html create mode 100644 doc/html/structlws__ext__option__arg.js create mode 100644 doc/html/structlws__ext__options.html create mode 100644 doc/html/structlws__ext__options.js create mode 100644 doc/html/structlws__extension.html create mode 100644 doc/html/structlws__extension.js create mode 100644 doc/html/structlws__gs__event__args.html create mode 100644 doc/html/structlws__gs__event__args.js create mode 100644 doc/html/structlws__http__mount.html create mode 100644 doc/html/structlws__http__mount.js create mode 100644 doc/html/structlws__plat__file__ops.html create mode 100644 doc/html/structlws__plat__file__ops.js create mode 100644 doc/html/structlws__plugin.html create mode 100644 doc/html/structlws__plugin.js create mode 100644 doc/html/structlws__plugin__capability.html create mode 100644 doc/html/structlws__plugin__capability.js create mode 100644 doc/html/structlws__polarssl__context.html create mode 100644 doc/html/structlws__polarssl__context.js create mode 100644 doc/html/structlws__pollargs.html create mode 100644 doc/html/structlws__pollargs.js create mode 100644 doc/html/structlws__pollfd.html create mode 100644 doc/html/structlws__pollfd.js create mode 100644 doc/html/structlws__process__html__args.html create mode 100644 doc/html/structlws__process__html__args.js create mode 100644 doc/html/structlws__process__html__state.html create mode 100644 doc/html/structlws__process__html__state.js create mode 100644 doc/html/structlws__protocol__vhost__options.html create mode 100644 doc/html/structlws__protocol__vhost__options.js create mode 100644 doc/html/structlws__protocols.html create mode 100644 doc/html/structlws__protocols.js create mode 100644 doc/html/structlws__session__info.html create mode 100644 doc/html/structlws__session__info.js create mode 100644 doc/html/structlws__token__limits.html create mode 100644 doc/html/structlws__token__limits.js create mode 100644 doc/html/structlws__tokens.html create mode 100644 doc/html/structlws__tokens.js create mode 100644 doc/html/structlwsgw__hash.html create mode 100644 doc/html/structlwsgw__hash.js create mode 100644 doc/html/structlwsgw__hash__bin.html create mode 100644 doc/html/structlwsgw__hash__bin.js create mode 100644 doc/html/structpollfd.html create mode 100644 doc/html/structpollfd.js create mode 100644 doc/html/sync_off.png create mode 100644 doc/html/sync_on.png create mode 100644 doc/html/tab_a.png create mode 100644 doc/html/tab_b.png create mode 100644 doc/html/tab_h.png create mode 100644 doc/html/tab_s.png create mode 100644 doc/html/tabs.css create mode 100644 doc/latex/annotated.tex create mode 100644 doc/latex/classlws__conn.eps create mode 100644 doc/latex/classlws__conn.pdf create mode 100644 doc/latex/classlws__conn.tex create mode 100644 doc/latex/classlws__conn__listener.eps create mode 100644 doc/latex/classlws__conn__listener.pdf create mode 100644 doc/latex/classlws__conn__listener.tex create mode 100644 doc/latex/deprecated.tex create mode 100644 doc/latex/dir_97aefd0d527b934f1d99a682da8fe6a9.tex create mode 100644 doc/latex/doxygen.sty create mode 100644 doc/latex/files.tex create mode 100644 doc/latex/group__HTTP-headers-create.tex create mode 100644 doc/latex/group__HTTP-headers-read.tex create mode 100644 doc/latex/group__Protocols-and-Plugins.tex create mode 100644 doc/latex/group__callback-when-writeable.tex create mode 100644 doc/latex/group__cgi.tex create mode 100644 doc/latex/group__client.tex create mode 100644 doc/latex/group__context-and-vhost.tex create mode 100644 doc/latex/group__ev.tex create mode 100644 doc/latex/group__extensions.tex create mode 100644 doc/latex/group__fops.tex create mode 100644 doc/latex/group__form-parsing.tex create mode 100644 doc/latex/group__generic-sessions.tex create mode 100644 doc/latex/group__html-chunked-substitution.tex create mode 100644 doc/latex/group__http.tex create mode 100644 doc/latex/group__httpft.tex create mode 100644 doc/latex/group__log.tex create mode 100644 doc/latex/group__misc.tex create mode 100644 doc/latex/group__net.tex create mode 100644 doc/latex/group__pur.tex create mode 100644 doc/latex/group__sending-data.tex create mode 100644 doc/latex/group__service.tex create mode 100644 doc/latex/group__sha.tex create mode 100644 doc/latex/group__smtp.tex create mode 100644 doc/latex/group__sock-adopt.tex create mode 100644 doc/latex/group__timeout.tex create mode 100644 doc/latex/group__urlendec.tex create mode 100644 doc/latex/group__usercb.tex create mode 100644 doc/latex/group__uv.tex create mode 100644 doc/latex/group__vhost-mounts.tex create mode 100644 doc/latex/group__wsclose.tex create mode 100644 doc/latex/group__wsstatus.tex create mode 100644 doc/latex/hierarchy.tex create mode 100644 doc/latex/index.tex create mode 100644 doc/latex/libwebsockets_8h.tex create mode 100644 doc/latex/md_README.build.tex create mode 100644 doc/latex/md_README.coding.tex create mode 100644 doc/latex/md_README.generic-sessions.tex create mode 100644 doc/latex/md_README.lwsws.tex create mode 100644 doc/latex/md_README.test-apps.tex create mode 100644 doc/latex/modules.tex create mode 100644 doc/latex/refman.tex create mode 100644 doc/latex/structlws__cgi__args.tex create mode 100644 doc/latex/structlws__client__connect__info.tex create mode 100644 doc/latex/structlws__context__creation__info.tex create mode 100644 doc/latex/structlws__email.tex create mode 100644 doc/latex/structlws__ext__option__arg.tex create mode 100644 doc/latex/structlws__ext__options.tex create mode 100644 doc/latex/structlws__extension.tex create mode 100644 doc/latex/structlws__gs__event__args.tex create mode 100644 doc/latex/structlws__http__mount.tex create mode 100644 doc/latex/structlws__plat__file__ops.tex create mode 100644 doc/latex/structlws__plugin.tex create mode 100644 doc/latex/structlws__plugin__capability.tex create mode 100644 doc/latex/structlws__polarssl__context.tex create mode 100644 doc/latex/structlws__pollargs.tex create mode 100644 doc/latex/structlws__pollfd.tex create mode 100644 doc/latex/structlws__process__html__args.tex create mode 100644 doc/latex/structlws__process__html__state.tex create mode 100644 doc/latex/structlws__protocol__vhost__options.tex create mode 100644 doc/latex/structlws__protocols.tex create mode 100644 doc/latex/structlws__session__info.tex create mode 100644 doc/latex/structlws__token__limits.tex create mode 100644 doc/latex/structlws__tokens.tex create mode 100644 doc/latex/structlwsgw__hash.tex create mode 100644 doc/latex/structlwsgw__hash__bin.tex create mode 100644 doc/latex/structpollfd.tex delete mode 100644 libwebsockets-api-doc.html create mode 100644 libwebsockets.dox create mode 100644 mainpage.md delete mode 100755 scripts/kernel-doc diff --git a/CMakeLists.txt b/CMakeLists.txt index 568c0437..780972c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1396,22 +1396,6 @@ if (LWS_WITH_LWSWS) endif (LWS_WITH_LWSWS) if (UNIX) - # Generate documentation. - # TODO: Fix this on Windows. - message("Generating API documentation") - file(GLOB C_FILES "${PROJECT_SOURCE_DIR}/lib/*.c") - list(SORT C_FILES) - execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${PROJECT_BINARY_DIR}/doc/") - - execute_process( - COMMAND "${PROJECT_SOURCE_DIR}/scripts/kernel-doc" -html ${C_FILES} ${HDR_PUBLIC} - OUTPUT_FILE "${PROJECT_BINARY_DIR}/doc/libwebsockets-api-doc.html" - ERROR_QUIET) - - execute_process( - COMMAND "${PROJECT_SOURCE_DIR}/scripts/kernel-doc" -text ${C_FILES} ${HDR_PUBLIC} - OUTPUT_FILE "${PROJECT_BINARY_DIR}/doc/libwebsockets-api-doc.txt" - ERROR_QUIET) # Generate and install pkgconfig. # (This is not indented, because the tabs will be part of the output) diff --git a/README.build.md b/README.build.md index 0b8a90be..4055ecf1 100644 --- a/README.build.md +++ b/README.build.md @@ -1,3 +1,7 @@ +Notes about building lws +======================== + + Introduction to CMake --------------------- @@ -38,73 +42,64 @@ Building on Unix: 2. Install OpenSSL. 3. Generate the build files (default is Make files): +``` + $ cd /path/to/src + $ mkdir build + $ cd build + $ cmake .. +``` - ```bash - $ cd /path/to/src - $ mkdir build - $ cd build - $ cmake .. - ``` +4. Finally you can build using the generated Makefile: +``` + $ make && sudo make install +``` +**NOTE**: The `build/`` 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 **libwebsockets** containing the [CMakeLists.txt](CMakeLists.txt) + project file. All examples in this file assumes you use ".." - (**NOTE**: The `build/`` 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 **libwebsockets** containing the [CMakeLists.txt](CMakeLists.txt) - project file. All examples in this file assumes you use "..") +**NOTE2**: +A common option you may want to give is to set the install path, same +as --prefix= with autotools. It defaults to /usr/local. +You can do this by, eg +``` + $ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr . +``` - **NOTE2**: - A common option you may want to give is to set the install path, same - as --prefix= with autotools. It defaults to /usr/local. - You can do this by, eg - - ```bash - $ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. - ``` - - **NOTE3**: - On machines that want libraries in lib64, you can also add the - following to the cmake line - - ```bash +**NOTE3**: +On machines that want libraries in lib64, you can also add the +following to the cmake line +``` -DLIB_SUFFIX=64 - ``` +``` - **NOTE4**: - If you are building against a non-distro OpenSSL (eg, in order to get - access to ALPN support only in newer OpenSSL versions) the nice way to - express that in one cmake command is eg, - - ```bash +**NOTE4**: +If you are building against a non-distro OpenSSL (eg, in order to get +access to ALPN support only in newer OpenSSL versions) the nice way to +express that in one cmake command is eg, +``` $ cmake .. -DOPENSSL_ROOT_DIR=/usr/local/ssl \ -DCMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE=/usr/local/ssl \ -DLWS_WITH_HTTP2=1 - ``` +``` - When you run the test apps using non-distro SSL, you have to force them - to use your libs, not the distro ones - - ```bash +When you run the test apps using non-distro SSL, you have to force them +to use your libs, not the distro ones +``` $ LD_LIBRARY_PATH=/usr/local/ssl/lib libwebsockets-test-server --ssl - ``` +``` - To get it to build on latest openssl (2016-04-10) it needed this approach - - ```bash +To get it to build on latest openssl (2016-04-10) it needed this approach +``` cmake .. -DLWS_WITH_HTTP2=1 -DLWS_OPENSSL_INCLUDE_DIRS=/usr/local/include/openssl -DLWS_OPENSSL_LIBRARIES="/usr/local/lib64/libssl.so;/usr/local/lib64/libcrypto.so" - ``` +``` - **NOTE5**: - To build with debug info and _DEBUG for lower priority debug messages - compiled in, use - - ```bash +**NOTE5**: +To build with debug info and _DEBUG for lower priority debug messages +compiled in, use +``` $ cmake .. -DCMAKE_BUILD_TYPE=DEBUG - ```` - -4. Finally you can build using the generated Makefile: - - ```bash - $ make - ``` +``` Quirk of cmake -------------- @@ -127,12 +122,12 @@ Building on Windows (Visual Studio) 3. Generate the Visual studio project by opening the Visual Studio cmd prompt: - ```bash - cd - md build - cd build - cmake -G "Visual Studio 10" .. - ``` +``` + cd + md build + cd build + cmake -G "Visual Studio 10" .. +``` (**NOTE**: There is also a cmake-gui available on Windows if you prefer that) @@ -161,23 +156,21 @@ Building on Windows (MinGW) 2. Fix up MinGW headers a) Add the following lines to C:\MinGW\include\winsock2.h: - - ```c - #if(_WIN32_WINNT >= 0x0600) +``` + #if(_WIN32_WINNT >= 0x0600) - typedef struct pollfd { + typedef struct pollfd { - SOCKET fd; - SHORT events; - SHORT revents; + SOCKET fd; + SHORT events; + SHORT revents; - } WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD; + } WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD; - WINSOCK_API_LINKAGE int WSAAPI WSAPoll(LPWSAPOLLFD fdArray, ULONG fds, INT timeout); - - #endif // (_WIN32_WINNT >= 0x0600) - ``` + WINSOCK_API_LINKAGE int WSAAPI WSAPoll(LPWSAPOLLFD fdArray, ULONG fds, INT timeout); + #endif // (_WIN32_WINNT >= 0x0600) +``` b) Create C:\MinGW\include\mstcpip.h and copy and paste the content from following link into it: http://wine-unstable.sourcearchive.com/documentation/1.1.32/mstcpip_8h-source.html @@ -193,14 +186,12 @@ Building on Windows (MinGW) \bin\openssl.cfg 5. Generate the build files (default is Make files) using MSYS shell: - - ```bash - $ cd /drive/path/to/src - $ mkdir build - $ cd build - $ cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=C:/MinGW .. - ``` - +``` + $ cd /drive/path/to/src + $ mkdir build + $ cd build + $ cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=C:/MinGW .. +``` (**NOTE**: The `build/`` 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 **libwebsockets** containing the [CMakeLists.txt](CMakeLists.txt) @@ -209,17 +200,15 @@ Building on Windows (MinGW) **NOTE2**: To generate build files allowing to create libwebsockets binaries with debug information set the CMAKE_BUILD_TYPE flag to DEBUG: - - ```bash - $ cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=C:/MinGW -DCMAKE_BUILD_TYPE=DEBUG .. - ``` - +``` + $ cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=C:/MinGW -DCMAKE_BUILD_TYPE=DEBUG .. +``` 6. Finally you can build using the generated Makefile and get the results deployed into your MinGW installation: - ```bash - $ make - $ make install - ``` +``` + $ make + $ make install +``` Setting compile options ----------------------- @@ -307,22 +296,20 @@ this to work. Compiling libwebsockets with wolfSSL ------------------------------------ - -```bash -cmake .. -DLWS_USE_WOLFSSL=1 \ - -DLWS_WOLFSSL_INCLUDE_DIRS=/path/to/wolfssl \ - -DLWS_WOLFSSL_LIBRARIES=/path/to/wolfssl/wolfssl.a .. +``` + cmake .. -DLWS_USE_WOLFSSL=1 \ + -DLWS_WOLFSSL_INCLUDE_DIRS=/path/to/wolfssl \ + -DLWS_WOLFSSL_LIBRARIES=/path/to/wolfssl/wolfssl.a .. ``` **NOTE**: On windows use the .lib file extension for `LWS_WOLFSSL_LIBRARIES` instead. Compiling libwebsockets with CyaSSL ----------------------------------- - -```bash -cmake .. -DLWS_USE_CYASSL=1 \ - -DLWS_CYASSL_INCLUDE_DIRS=/path/to/cyassl \ - -DLWS_CYASSL_LIBRARIES=/path/to/wolfssl/cyassl.a .. +``` + cmake .. -DLWS_USE_CYASSL=1 \ + -DLWS_CYASSL_INCLUDE_DIRS=/path/to/cyassl \ + -DLWS_CYASSL_LIBRARIES=/path/to/wolfssl/cyassl.a .. ``` **NOTE**: On windows use the .lib file extension for `LWS_CYASSL_LIBRARIES` instead. @@ -336,10 +323,10 @@ there is an "mbedtls" package which is actually using polarssl for the include d and polarssl apis... this should be treated as polarssl then. Example config for this case is - +``` cmake .. -DLWS_USE_POLARSSL=1 -DLWS_POLARSSL_LIBRARIES=/usr/lib64/libmbedtls.so \ -DLWS_POLARSSL_INCLUDE_DIRS=/usr/include/polarssl/ - +``` Building plugins outside of lws itself -------------------------------------- @@ -347,13 +334,12 @@ Building plugins outside of lws itself The directory ./plugin-standalone/ shows how easy it is to create plugins outside of lws itself. First build lws itself with -DLWS_WITH_PLUGINS, then use the same flow to build the standalone plugin - ``` -cd ./plugin-standalone -mkdir build -cd build -cmake .. -make && sudo make install + cd ./plugin-standalone + mkdir build + cd build + cmake .. + make && sudo make install ``` if you changed the default plugin directory when you built lws, you must @@ -362,16 +348,14 @@ also give the same arguments to cmake here (eg, Otherwise if you run lwsws or libwebsockets-test-server-v2.0, it will now find the additional plugin "libprotocol_example_standalone.so" - ``` -lwsts[21257]: Plugins: -lwsts[21257]: libprotocol_dumb_increment.so -lwsts[21257]: libprotocol_example_standalone.so -lwsts[21257]: libprotocol_lws_mirror.so -lwsts[21257]: libprotocol_lws_server_status.so -lwsts[21257]: libprotocol_lws_status.so + lwsts[21257]: Plugins: + lwsts[21257]: libprotocol_dumb_increment.so + lwsts[21257]: libprotocol_example_standalone.so + lwsts[21257]: libprotocol_lws_mirror.so + lwsts[21257]: libprotocol_lws_server_status.so + lwsts[21257]: libprotocol_lws_status.so ``` - 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->pvo or for lwsws, in the JSON config. @@ -383,25 +367,20 @@ Reproducing HTTP2.0 tests You must have built and be running lws against a version of openssl that has ALPN / NPN. Most distros still have older versions. You'll know it's right by seeing - -```bash -lwsts[4752]: Compiled with OpenSSL support -lwsts[4752]: Using SSL mode -lwsts[4752]: HTTP2 / ALPN enabled ``` - + lwsts[4752]: Compiled with OpenSSL support + lwsts[4752]: Using SSL mode + lwsts[4752]: HTTP2 / ALPN enabled +``` at lws startup. For non-SSL HTTP2.0 upgrade - -```bash -$ nghttp -nvasu http://localhost:7681/test.htm ``` - + $ nghttp -nvasu http://localhost:7681/test.htm +``` For SSL / ALPN HTTP2.0 upgrade - ``` -$ nghttp -nvas https://localhost:7681/test.html + $ nghttp -nvas https://localhost:7681/test.html ``` Cross compiling @@ -415,13 +394,11 @@ to look for dependencies and such. you can use as a starting point. The commandline to configure for cross with this would look like - -```bash -$ cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DCMAKE_TOOLCHAIN_FILE=../cross-arm-linux-gnueabihf.cmake \ - -DWITHOUT_EXTENSIONS=1 -DWITH_SSL=0 ``` - + $ cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr \ + -DCMAKE_TOOLCHAIN_FILE=../cross-arm-linux-gnueabihf.cmake \ + -DWITHOUT_EXTENSIONS=1 -DWITH_SSL=0 +``` The example shows how to build with no external cross lib dependencies, you need to provide the cross libraries otherwise. @@ -439,17 +416,15 @@ on websocket connections), but with full v13 websocket features and http server, built on ARM Cortex-A9: Update at 8dac94d (2013-02-18) - -```bash -$ ./configure --without-client --without-extensions --disable-debug --without-daemonize - -Context Creation, 1024 fd limit[2]: 16720 (includes 12 bytes per fd) -Per-connection [3]: 72 bytes, +1328 during headers - -.text .rodata .data .bss -11512 2784 288 4 ``` + $ ./configure --without-client --without-extensions --disable-debug --without-daemonize + Context Creation, 1024 fd limit[2]: 16720 (includes 12 bytes per fd) + Per-connection [3]: 72 bytes, +1328 during headers + + .text .rodata .data .bss + 11512 2784 288 4 +``` This shows the impact of the major configuration with/without options at 13ba5bbc633ea962d46d using Ubuntu ARM on a PandaBoard ES. diff --git a/README.coding.md b/README.coding.md index a4da4db7..054c11ce 100644 --- a/README.coding.md +++ b/README.coding.md @@ -1,3 +1,6 @@ +Notes about coding with lws +=========================== + Daemonization ------------- @@ -74,7 +77,8 @@ clients). If you want to send something, do not just send it but request a callback when the socket is writeable using - - `lws_callback_on_writable(context, wsi)`` for a specific `wsi`, or + - `lws_callback_on_writable(context, wsi)` for a specific `wsi`, or + - `lws_callback_on_writable_all_protocol(protocol)` for all connections using that protocol to get a callback when next writeable. @@ -130,24 +134,24 @@ check can be combined with `libwebsockets_remaining_packet_payload` to gather the whole contents of a message, eg: ``` - case LWS_CALLBACK_RECEIVE: - { - Client * const client = (Client *)user; - const size_t remaining = lws_remaining_packet_payload(wsi); - - if (!remaining && lws_is_final_fragment(wsi)) { - if (client->HasFragments()) { - client->AppendMessageFragment(in, len, 0); - in = (void *)client->GetMessage(); - len = client->GetMessageLength(); - } - - client->ProcessMessage((char *)in, len, wsi); - client->ResetMessage(); - } else - client->AppendMessageFragment(in, len, remaining); - } - break; + case LWS_CALLBACK_RECEIVE: + { + Client * const client = (Client *)user; + const size_t remaining = lws_remaining_packet_payload(wsi); + + if (!remaining && lws_is_final_fragment(wsi)) { + if (client->HasFragments()) { + client->AppendMessageFragment(in, len, 0); + in = (void *)client->GetMessage(); + len = client->GetMessageLength(); + } + + client->ProcessMessage((char *)in, len, wsi); + client->ResetMessage(); + } else + client->AppendMessageFragment(in, len, remaining); + } + break; ``` The test app libwebsockets-test-fraggle sources also show how to @@ -205,14 +209,14 @@ Using with in c++ apps The library is ready for use by C++ apps. You can get started quickly by copying the test server -```bash -$ cp test-server/test-server.c test.cpp +``` + $ cp test-server/test-server.c test.cpp ``` and building it in C++ like this -```bash -$ g++ -DINSTALL_DATADIR=\"/usr/share\" -ocpptest test.cpp -lwebsockets +``` + $ g++ -DINSTALL_DATADIR=\"/usr/share\" -ocpptest test.cpp -lwebsockets ``` `INSTALL_DATADIR` is only needed because the test server uses it as shipped, if @@ -266,10 +270,12 @@ context-creation time. You might want to look into that to stop the ssl peers selecting a cipher which is too computationally expensive. To use it, point it to a string like -`"RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL"` + `"RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL"` if left `NULL`, then the "DEFAULT" set of ciphers are all possible to select. +You can also set it to `"ALL"` to allow everything (including insecure ciphers). + Async nature of client connections ---------------------------------- @@ -306,27 +312,31 @@ lws prepares a file operations structure that lives in the lws context. The user code can get a pointer to the file operations struct -LWS_VISIBLE LWS_EXTERN struct lws_plat_file_ops * -`lws_get_fops`(struct lws_context *context); +``` + LWS_VISIBLE LWS_EXTERN struct lws_plat_file_ops * + `lws_get_fops`(struct lws_context *context); +``` and then can use helpers to also leverage these platform-independent file handling apis -static inline lws_filefd_type -`lws_plat_file_open`(struct lws *wsi, const char *filename, unsigned long *filelen, int flags) +``` + static inline lws_filefd_type + `lws_plat_file_open`(struct lws *wsi, const char *filename, unsigned long *filelen, int flags) -static inline int -`lws_plat_file_close`(struct lws *wsi, lws_filefd_type fd) + static inline int + `lws_plat_file_close`(struct lws *wsi, lws_filefd_type fd) -static inline unsigned long -`lws_plat_file_seek_cur`(struct lws *wsi, lws_filefd_type fd, long offset_from_cur_pos) + static inline unsigned long + `lws_plat_file_seek_cur`(struct lws *wsi, lws_filefd_type fd, long offset_from_cur_pos) -static inline int -`lws_plat_file_read`(struct lws *wsi, lws_filefd_type fd, unsigned long *amount, unsigned char *buf, unsigned long len) + static inline int + `lws_plat_file_read`(struct lws *wsi, lws_filefd_type fd, unsigned long *amount, unsigned char *buf, unsigned long len) + + static inline int + `lws_plat_file_write`(struct lws *wsi, lws_filefd_type fd, unsigned long *amount, unsigned char *buf, unsigned long len) +``` -static inline int -`lws_plat_file_write`(struct lws *wsi, lws_filefd_type fd, unsigned long *amount, unsigned char *buf, unsigned long len) - The user code can also override or subclass the file operations, to either wrap or replace them. An example is shown in test server. @@ -335,11 +345,11 @@ ECDH Support ECDH Certs are now supported. Enable the CMake option -cmake .. -DLWS_SSL_SERVER_WITH_ECDH_CERT=1 + cmake .. -DLWS_SSL_SERVER_WITH_ECDH_CERT=1 **and** the info->options flag -LWS_SERVER_OPTION_SSL_ECDH + LWS_SERVER_OPTION_SSL_ECDH to build in support and select it at runtime. @@ -397,14 +407,14 @@ Libev / Libuv support You can select either or both --DLWS_WITH_LIBEV=1 --DLWS_WITH_LIBUV=1 + -DLWS_WITH_LIBEV=1 + -DLWS_WITH_LIBUV=1 at cmake configure-time. The user application may use one of the context init options flags -LWS_SERVER_OPTION_LIBEV -LWS_SERVER_OPTION_LIBUV + LWS_SERVER_OPTION_LIBEV + LWS_SERVER_OPTION_LIBUV to indicate it will use either of the event libraries. @@ -413,12 +423,13 @@ Extension option control from user code --------------------------------------- User code may set per-connection extension options now, using a new api -"lws_set_extension_option()". +`lws_set_extension_option()`. This should be called from the ESTABLISHED callback like this - - lws_set_extension_option(wsi, "permessage-deflate", - "rx_buf_size", "12"); /* 1 << 12 */ +``` + lws_set_extension_option(wsi, "permessage-deflate", + "rx_buf_size", "12"); /* 1 << 12 */ +``` If the extension is not active (missing or not negotiated for the connection, or extensions are disabled on the library) the call is @@ -450,7 +461,7 @@ flow control, and process the data in the writable callback. Either way you use the api `lws_http_client_read()` to access the data, eg - +``` case LWS_CALLBACK_RECEIVE_CLIENT_HTTP: { char buffer[1024 + LWS_PRE]; @@ -472,7 +483,8 @@ data, eg putchar(*px++); } break; - +``` + Using lws v2 vhosts ------------------- @@ -482,10 +494,10 @@ members for compatibility. Instead you can call lws_create_vhost() afterwards to attach one or more vhosts manually. ``` -LWS_VISIBLE struct lws_vhost * -lws_create_vhost(struct lws_context *context, - struct lws_context_creation_info *info, - struct lws_http_mount *mounts); + LWS_VISIBLE struct lws_vhost * + lws_create_vhost(struct lws_context *context, + struct lws_context_creation_info *info, + struct lws_http_mount *mounts); ``` lws_create_vhost() uses the same info struct as lws_create_context(), @@ -493,12 +505,12 @@ it ignores members related to context and uses the ones meaningful for vhost (marked with VH in libwebsockets.h). ``` -struct lws_context_creation_info { - int port; /* VH */ - const char *iface; /* VH */ - const struct lws_protocols *protocols; /* VH */ - const struct lws_extension *extensions; /* VH */ -... + struct lws_context_creation_info { + int port; /* VH */ + const char *iface; /* VH */ + const struct lws_protocols *protocols; /* VH */ + const struct lws_extension *extensions; /* VH */ + ... ``` When you attach the vhost, if the vhost's port already has a listen socket @@ -519,24 +531,24 @@ a similar way that unix lets you mount filesystems into areas of your / filesystem how you like and deal with the contents transparently. ``` -struct lws_http_mount { - struct lws_http_mount *mount_next; - const char *mountpoint; /* mountpoint in http pathspace, eg, "/" */ - const char *origin; /* path to be mounted, eg, "/var/www/warmcat.com" */ - const char *def; /* default target, eg, "index.html" */ - - struct lws_protocol_vhost_options *cgienv; - - int cgi_timeout; - int cache_max_age; - - unsigned int cache_reusable:1; - unsigned int cache_revalidate:1; - unsigned int cache_intermediaries:1; - - unsigned char origin_protocol; - unsigned char mountpoint_len; -}; + struct lws_http_mount { + struct lws_http_mount *mount_next; + const char *mountpoint; /* mountpoint in http pathspace, eg, "/" */ + const char *origin; /* path to be mounted, eg, "/var/www/warmcat.com" */ + const char *def; /* default target, eg, "index.html" */ + + struct lws_protocol_vhost_options *cgienv; + + int cgi_timeout; + int cache_max_age; + + unsigned int cache_reusable:1; + unsigned int cache_revalidate:1; + unsigned int cache_intermediaries:1; + + unsigned char origin_protocol; + unsigned char mountpoint_len; + }; ``` The last mount structure should have a NULL mount_next, otherwise it should @@ -548,27 +560,27 @@ destroyed, since they are not copied but used in place. `.origin_protocol` should be one of ``` -enum { - LWSMPRO_HTTP, - LWSMPRO_HTTPS, - LWSMPRO_FILE, - LWSMPRO_CGI, - LWSMPRO_REDIR_HTTP, - LWSMPRO_REDIR_HTTPS, - LWSMPRO_CALLBACK, -}; + enum { + LWSMPRO_HTTP, + LWSMPRO_HTTPS, + LWSMPRO_FILE, + LWSMPRO_CGI, + LWSMPRO_REDIR_HTTP, + LWSMPRO_REDIR_HTTPS, + LWSMPRO_CALLBACK, + }; ``` -LWSMPRO_FILE is used for mapping url namespace to a filesystem directory and + - LWSMPRO_FILE is used for mapping url namespace to a filesystem directory and serve it automatically. -LWSMPRO_CGI associates the url namespace with the given CGI executable, which + - LWSMPRO_CGI associates the url namespace with the given CGI executable, which runs when the URL is accessed and the output provided to the client. -LWSMPRO_REDIR_HTTP and LWSMPRO_REDIR_HTTPS auto-redirect clients to the given + - LWSMPRO_REDIR_HTTP and LWSMPRO_REDIR_HTTPS auto-redirect clients to the given origin URL. -LWSMPRO_CALLBACK causes the http connection to attach to the callback + - LWSMPRO_CALLBACK causes the http connection to attach to the callback associated with the named protocol (which may be a plugin). @@ -583,20 +595,20 @@ in test-server-v2.0.c, the URL area "/formtest" is associated with the plugin providing "protocol-post-demo" like this ``` -static const struct lws_http_mount mount_post = { - NULL, /* linked-list pointer to next*/ - "/formtest", /* mountpoint in URL namespace on this vhost */ - "protocol-post-demo", /* handler */ - NULL, /* default filename if none given */ - NULL, - 0, - 0, - 0, - 0, - 0, - LWSMPRO_CALLBACK, /* origin points to a callback */ - 9, /* strlen("/formtest"), ie length of the mountpoint */ -}; + static const struct lws_http_mount mount_post = { + NULL, /* linked-list pointer to next*/ + "/formtest", /* mountpoint in URL namespace on this vhost */ + "protocol-post-demo", /* handler */ + NULL, /* default filename if none given */ + NULL, + 0, + 0, + 0, + 0, + 0, + LWSMPRO_CALLBACK, /* origin points to a callback */ + 9, /* strlen("/formtest"), ie length of the mountpoint */ + }; ``` Client access to /formtest[anything] will be passed to the callback registered diff --git a/README.generic-sessions.md b/README.generic-sessions.md index dab28734..7f2acc11 100644 --- a/README.generic-sessions.md +++ b/README.generic-sessions.md @@ -1,5 +1,5 @@ -Generic Sessions Plugin ------------------------ +Notes about generic-sessions Plugin +=================================== Enabling for build ------------------ @@ -34,7 +34,7 @@ authenticated as. Everything underneath is managed in generic-sessions. - admin account (with user-selectable username) is defined in config with a SHA-1 of the password; rest of the accounts are in sqlite3 - - user account passwords stored as salted SHA-1 with additional confounder + - user account passwords stored as salted SHA-1 with additional confounder only stored in the JSON config, not the database - login, logout, register account + email verification built-in with examples @@ -65,35 +65,33 @@ import that script file in your head section That's it. An example is below - ``` - - - - - - - - - - - -
- - -
-
- - - - - - + + + + + + + + + + + +
+ + +
+
+ + + + + + ``` - Overall Flow ------------ @@ -124,76 +122,76 @@ Configuration - b0 is set if you are logged in as a user at all. - b1 is set if you are logged in with the user configured to be admin - b2 is set if the account has been verified (the account configured for admin is always verified) + - b3 is set if your session just did the forgot password flow successfully ``` - { - # things in here can always be served - "mountpoint": "/lwsgs", - "origin": "file:///usr/share/libwebsockets-test-server/generic-sessions", - "origin": "callback://protocol-lws-messageboard", - "default": "generic-sessions-login-example.html", - "auth-mask": "0", - "interpret": { - ".js": "protocol-lws-messageboard" - } - }, { - # things in here can only be served if logged in as a user - "mountpoint": "/lwsgs/needauth", - "origin": "file:///usr/share/libwebsockets-test-server/generic-sessions/needauth", - "origin": "callback://protocol-lws-messageboard", - "default": "generic-sessions-login-example.html", - "auth-mask": "5", # logged in as a verified user - "interpret": { - ".js": "protocol-lws-messageboard" - } - }, { - # things in here can only be served if logged in as admin - "mountpoint": "/lwsgs/needadmin", - "origin": "file:///usr/share/libwebsockets-test-server/generic-sessions/needadmin", - "origin": "callback://protocol-lws-messageboard", - "default": "generic-sessions-login-example.html", - "auth-mask": "7", # b2 = verified (by email / or admin), b1 = admin, b0 = logged in with any user name - "interpret": { - ".js": "protocol-lws-messageboard" - } - } + { + # things in here can always be served + "mountpoint": "/lwsgs", + "origin": "file:///usr/share/libwebsockets-test-server/generic-sessions", + "origin": "callback://protocol-lws-messageboard", + "default": "generic-sessions-login-example.html", + "auth-mask": "0", + "interpret": { + ".js": "protocol-lws-messageboard" + } + }, { + # things in here can only be served if logged in as a user + "mountpoint": "/lwsgs/needauth", + "origin": "file:///usr/share/libwebsockets-test-server/generic-sessions/needauth", + "origin": "callback://protocol-lws-messageboard", + "default": "generic-sessions-login-example.html", + "auth-mask": "5", # logged in as a verified user + "interpret": { + ".js": "protocol-lws-messageboard" + } + }, { + # things in here can only be served if logged in as admin + "mountpoint": "/lwsgs/needadmin", + "origin": "file:///usr/share/libwebsockets-test-server/generic-sessions/needadmin", + "origin": "callback://protocol-lws-messageboard", + "default": "generic-sessions-login-example.html", + "auth-mask": "7", # b2 = verified (by email / or admin), b1 = admin, b0 = logged in with any user name + "interpret": { + ".js": "protocol-lws-messageboard" + } + } ``` - Note that the name of the real application protocol that uses generic-sessions is used, not generic-sessions itself. The vhost configures the storage dir, admin credentials and session cookie lifetimes: ``` - "ws-protocols": [{ - "protocol-generic-sessions": { - "status": "ok", - "admin-user": "admin", - -# create the pw hash like this (for the example pw, "jipdocesExunt" ) -# $ echo -n "jipdocesExunt" | sha1sum -# 046ce9a9cca769e85798133be06ef30c9c0122c9 - -# -# Obviously ** change this password hash to a secret one before deploying ** -# - "admin-password-sha1": "046ce9a9cca769e85798133be06ef30c9c0122c9", - "session-db": "/var/www/sessions/lws.sqlite3", - "timeout-idle-secs": "600", - "timeout-anon-idle-secs": "1200", - "timeout-absolute-secs": "6000", -# the confounder is part of the salted password hashes. If this config -# file is in a 0700 root:root dir, an attacker with apache credentials -# will have to get the confounder out of the process image to even try -# to guess the password hashes. - "confounder": "Change to <=31 chars of junk", - - "email-from": "noreply@example.com", - "email-smtp-ip": "127.0.0.1", - "email-expire": "3600", - "email-helo": "myhost.com", - "email-contact-person": "Set Me ", - "email-confirm-url-base": "http://localhost:7681/lwsgs" - } + "ws-protocols": [{ + "protocol-generic-sessions": { + "status": "ok", + "admin-user": "admin", + + # create the pw hash like this (for the example pw, "jipdocesExunt" ) + # $ echo -n "jipdocesExunt" | sha1sum + # 046ce9a9cca769e85798133be06ef30c9c0122c9 - + # + # Obviously ** change this password hash to a secret one before deploying ** + # + "admin-password-sha1": "046ce9a9cca769e85798133be06ef30c9c0122c9", + "session-db": "/var/www/sessions/lws.sqlite3", + "timeout-idle-secs": "600", + "timeout-anon-idle-secs": "1200", + "timeout-absolute-secs": "6000", + # the confounder is part of the salted password hashes. If this config + # file is in a 0700 root:root dir, an attacker with apache credentials + # will have to get the confounder out of the process image to even try + # to guess the password hashes. + "confounder": "Change to <=31 chars of junk", + + "email-from": "noreply@example.com", + "email-smtp-ip": "127.0.0.1", + "email-expire": "3600", + "email-helo": "myhost.com", + "email-contact-person": "Set Me ", + "email-confirm-url-base": "http://localhost:7681/lwsgs" + } ``` The email- related settings control generation of automatic emails for @@ -219,11 +217,12 @@ The real protocol that makes use of generic-sessions must also be listed and any configuration it needs given ``` - "protocol-lws-messageboard": { - "status": "ok", - "message-db": "/var/www/sessions/messageboard.sqlite3" - }, + "protocol-lws-messageboard": { + "status": "ok", + "message-db": "/var/www/sessions/messageboard.sqlite3" + }, ``` + Notice the real application uses his own sqlite db, no details about how generic-sessions works or how it stores data are available to it. @@ -244,9 +243,9 @@ You will have to prepare the db directory so it's suitable for the lwsws user to that usually means apache, eg ``` -# mkdir -p /var/www/sessions -# chown root:apache /var/www/sessions -# chmod 770 /var/www/sessions + # mkdir -p /var/www/sessions + # chown root:apache /var/www/sessions + # chmod 770 /var/www/sessions ``` Email configuration @@ -295,11 +294,11 @@ real protocol must allocate that space at runtime, using the pss size the generic-sessions protocol struct exposes ``` -struct per_session_data__myapp { - void *pss_gs; -... - - pss->pss_gs = malloc(vhd->gsp->per_session_data_size); + struct per_session_data__myapp { + void *pss_gs; + ... + + pss->pss_gs = malloc(vhd->gsp->per_session_data_size); ``` The allocation reserved for generic-sessions is then used as user_space when @@ -317,7 +316,6 @@ occur when a wsi binds to a protocol and when the binding is dropped. These should be used to malloc and free and kind of per-connection secondary allocations. - ``` case LWS_CALLBACK_HTTP_BIND_PROTOCOL: if (!pss || pss->pss_gs) @@ -353,16 +351,14 @@ Generic sessions lets another protocol check it again by calling his callback, and lws itself provides a generic session info struct to pass the related data ``` -struct lws_session_info { - char username[32]; - char email[100]; - char ip[72]; - unsigned int mask; - char session[42]; -}; -``` + struct lws_session_info { + char username[32]; + char email[100]; + char ip[72]; + unsigned int mask; + char session[42]; + }; -``` struct lws_session_info sinfo; ... vhd->gsp->callback(wsi, LWS_CALLBACK_SESSION_INFO, diff --git a/README.lwsws.md b/README.lwsws.md index b22853ef..4e7cb0a7 100644 --- a/README.lwsws.md +++ b/README.lwsws.md @@ -1,3 +1,6 @@ +Notes about lwsws +================= + Libwebsockets Web Server ------------------------ @@ -20,55 +23,49 @@ lwsws uses JSON config files, they're pure JSON but # may be used to turn the re There is a single file intended for global settings /etc/lwsws/conf - ``` -# these are the server global settings -# stuff related to vhosts should go in one -# file per vhost in ../conf.d/ + # these are the server global settings + # stuff related to vhosts should go in one + # file per vhost in ../conf.d/ -{ - "global": { - "uid": "48", # apache user - "gid": "48", # apache user - "count-threads": "1", - "server-string": "myserver v1", # returned in http headers - "init-ssl": "yes" - } -} + { + "global": { + "uid": "48", # apache user + "gid": "48", # apache user + "count-threads": "1", + "server-string": "myserver v1", # returned in http headers + "init-ssl": "yes" + } + } ``` - and a config directory intended to take one file per vhost /etc/lwsws/conf.d/warmcat.com - ``` -{ - "vhosts": [{ - "name": "warmcat.com", - "port": "443", - "interface": "eth0", # optional - "host-ssl-key": "/etc/pki/tls/private/warmcat.com.key", # if given enable ssl - "host-ssl-cert": "/etc/pki/tls/certs/warmcat.com.crt", - "host-ssl-ca": "/etc/pki/tls/certs/warmcat.com.cer", - "mounts": [{ # autoserve - "mountpoint": "/", - "origin": "file:///var/www/warmcat.com", - "default": "index.html" + { + "vhosts": [{ + "name": "warmcat.com", + "port": "443", + "interface": "eth0", # optional + "host-ssl-key": "/etc/pki/tls/private/warmcat.com.key", # if given enable ssl + "host-ssl-cert": "/etc/pki/tls/certs/warmcat.com.crt", + "host-ssl-ca": "/etc/pki/tls/certs/warmcat.com.cer", + "mounts": [{ # autoserve + "mountpoint": "/", + "origin": "file:///var/www/warmcat.com", + "default": "index.html" + }] }] - }] -} + } ``` - To get started quickly, an example config reproducing the old test server on port 7681, non-SSL is provided. To set it up - ``` -# mkdir -p /etc/lwsws/conf.d /var/log/lwsws -# cp ./lwsws/etc-lwsws-conf-EXAMPLE /etc/lwsws/conf -# cp ./lwsws/etc-lwsws-conf.d-localhost-EXAMPLE /etc/lwsws/conf.d/test-server -# sudo lwsws + # mkdir -p /etc/lwsws/conf.d /var/log/lwsws + # cp ./lwsws/etc-lwsws-conf-EXAMPLE /etc/lwsws/conf + # cp ./lwsws/etc-lwsws-conf.d-localhost-EXAMPLE /etc/lwsws/conf.d/test-server + # sudo lwsws ``` - Vhosts ------ @@ -77,55 +74,54 @@ the connection to a vhost and its vhost-specific SSL keys during SSL negotiation. Listing multiple vhosts looks something like this - ``` -{ - "vhosts": [ { - "name": "localhost", - "port": "443", - "host-ssl-key": "/etc/pki/tls/private/libwebsockets.org.key", - "host-ssl-cert": "/etc/pki/tls/certs/libwebsockets.org.crt", - "host-ssl-ca": "/etc/pki/tls/certs/libwebsockets.org.cer", - "mounts": [{ - "mountpoint": "/", - "origin": "file:///var/www/libwebsockets.org", - "default": "index.html" - }, { - "mountpoint": "/testserver", - "origin": "file:///usr/local/share/libwebsockets-test-server", - "default": "test.html" - }], - # which protocols are enabled for this vhost, and optional - # vhost-specific config options for the protocol - # - "ws-protocols": [{ - "warmcat,timezoom": { - "status": "ok" - } - }] - }, - { - "name": "localhost", - "port": "7681", - "host-ssl-key": "/etc/pki/tls/private/libwebsockets.org.key", - "host-ssl-cert": "/etc/pki/tls/certs/libwebsockets.org.crt", - "host-ssl-ca": "/etc/pki/tls/certs/libwebsockets.org.cer", - "mounts": [{ - "mountpoint": "/", - "origin": ">https://localhost" - }] - }, - { - "name": "localhost", - "port": "80", - "mounts": [{ - "mountpoint": "/", - "origin": ">https://localhost" - }] - } - - ] -} + { + "vhosts": [ { + "name": "localhost", + "port": "443", + "host-ssl-key": "/etc/pki/tls/private/libwebsockets.org.key", + "host-ssl-cert": "/etc/pki/tls/certs/libwebsockets.org.crt", + "host-ssl-ca": "/etc/pki/tls/certs/libwebsockets.org.cer", + "mounts": [{ + "mountpoint": "/", + "origin": "file:///var/www/libwebsockets.org", + "default": "index.html" + }, { + "mountpoint": "/testserver", + "origin": "file:///usr/local/share/libwebsockets-test-server", + "default": "test.html" + }], + # which protocols are enabled for this vhost, and optional + # vhost-specific config options for the protocol + # + "ws-protocols": [{ + "warmcat,timezoom": { + "status": "ok" + } + }] + }, + { + "name": "localhost", + "port": "7681", + "host-ssl-key": "/etc/pki/tls/private/libwebsockets.org.key", + "host-ssl-cert": "/etc/pki/tls/certs/libwebsockets.org.crt", + "host-ssl-ca": "/etc/pki/tls/certs/libwebsockets.org.cer", + "mounts": [{ + "mountpoint": "/", + "origin": ">https://localhost" + }] + }, + { + "name": "localhost", + "port": "80", + "mounts": [{ + "mountpoint": "/", + "origin": ">https://localhost" + }] + } + + ] + } ``` That sets up three vhosts all called "localhost" on ports 443 and 7681 with SSL, and port 80 without SSL but with a forced redirect to https://localhost @@ -153,14 +149,12 @@ Vhosts by default have available the union of any initial protocols from context any protocols exposed by plugins. Vhosts can select which plugins they want to offer and give them per-vhost settings using this syntax - -``` - "ws-protocols": [{ - "warmcat-timezoom": { - "status": "ok" - } - }] - +``` + "ws-protocols": [{ + "warmcat-timezoom": { + "status": "ok" + } + }] ``` The "x":"y" parameters like "status":"ok" are made available to the protocol during its per-vhost @@ -169,15 +163,13 @@ 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" - } - }] - +``` + "ws-protocols": [{ + "warmcat-timezoom": { + "status": "ok", + "default": "1" + } + }] ``` @@ -214,17 +206,15 @@ Other vhost options It may be used multiple times and OR's the flags together. The values are derived from /usr/include/openssl/ssl.h - - ``` - # define SSL_OP_NO_TLSv1_1 0x10000000L - ``` +``` + # define SSL_OP_NO_TLSv1_1 0x10000000L +``` would equate to +``` + "`ssl-option-set`": "268435456" ``` - "`ssl-option-set`": "268435456" - ``` - - "`ssl-option-clear'": "" Clears the SSL option flag value for the vhost. It may be used multiple times and OR's the flags together. @@ -239,72 +229,61 @@ Mount protocols are used to control what kind of translation happens - file:// serve the uri using the remainder of the url past the mountpoint based on the origin directory. Eg, with this mountpoint - ``` - { - "mountpoint": "/", - "origin": "file:///var/www/mysite.com", - "default": "/" - } + { + "mountpoint": "/", + "origin": "file:///var/www/mysite.com", + "default": "/" + } ``` - The uri /file.jpg would serve /var/www/mysite.com/file.jpg, since / matched. - ^http:// or ^https:// these cause any url matching the mountpoint to issue a redirect to the origin url - cgi:// this causes any matching url to be given to the named cgi, eg - ``` - { - "mountpoint": "/git", - "origin": "cgi:///var/www/cgi-bin/cgit", - "default": "/" - }, { - "mountpoint": "/cgit-data", - "origin": "file:///usr/share/cgit", - "default": "/" - }, + { + "mountpoint": "/git", + "origin": "cgi:///var/www/cgi-bin/cgit", + "default": "/" + }, { + "mountpoint": "/cgit-data", + "origin": "file:///usr/share/cgit", + "default": "/" + }, ``` - would cause the url /git/myrepo to pass "myrepo" to the cgi /var/www/cgi-bin/cgit and send the results to the client. -Note: currently only a fixed set of mimetypes are supported. Other mount options ------------------- 1) When using a cgi:// protcol origin at a mountpoint, you may also give cgi environment variables specific to the mountpoint like this - ``` - { - "mountpoint": "/git", - "origin": "cgi:///var/www/cgi-bin/cgit", - "default": "/", - "cgi-env": [{ - "CGIT_CONFIG": "/etc/cgitrc/libwebsockets.org" - }] - } + { + "mountpoint": "/git", + "origin": "cgi:///var/www/cgi-bin/cgit", + "default": "/", + "cgi-env": [{ + "CGIT_CONFIG": "/etc/cgitrc/libwebsockets.org" + }] + } ``` - This allows you to customize one cgi depending on the mountpoint (and / or vhost). 2) It's also possible to set the cgi timeout (in secs) per cgi:// mount, like this - ``` "cgi-timeout": "30" ``` - 3) `callback://` protocol may be used when defining a mount to associate a named protocol callback with the URL namespace area. For example - ``` - { - "mountpoint": "/formtest", - "origin": "callback://protocol-post-demo" - } + { + "mountpoint": "/formtest", + "origin": "callback://protocol-post-demo" + } ``` - All handling of client access to /formtest[anything] will be passed to the callback registered to the protocol "protocol-post-demo". @@ -315,24 +294,24 @@ See the related notes in README.coding.md 4) Cache policy of the files in the mount can also be set. If no options are given, the content is marked uncacheable. - - { - "mountpoint": "/", - "origin": "file:///var/www/mysite.com", - "cache-max-age": "60", # seconds - "cache-reuse": "1", # allow reuse at client at all - "cache-revalidate": "1", # check it with server each time - "cache-intermediaries": "1" # allow intermediary caches to hold - } - +``` + { + "mountpoint": "/", + "origin": "file:///var/www/mysite.com", + "cache-max-age": "60", # seconds + "cache-reuse": "1", # allow reuse at client at all + "cache-revalidate": "1", # check it with server each time + "cache-intermediaries": "1" # allow intermediary caches to hold + } +``` 4) You can also define a list of additional mimetypes per-mount - - "extra-mimetypes": { - ".zip": "application/zip", - ".doc": "text/evil" - } - +``` + "extra-mimetypes": { + ".zip": "application/zip", + ".doc": "text/evil" + } +``` Plugins ------- @@ -368,13 +347,13 @@ Additional plugin search paths Packages that have their own lws plugins can install them in their own preferred dir and ask lwsws to scan there by using a config fragment like this, in its own conf.d/ file managed by the other package - -{ - "global": { - "plugin-dir": "/usr/local/share/coherent-timeline/plugins" - } -} - +``` + { + "global": { + "plugin-dir": "/usr/local/share/coherent-timeline/plugins" + } + } +``` lws-server-status plugin ------------------------ @@ -382,22 +361,22 @@ lws-server-status plugin One provided protocol can be used to monitor the server status. Enable the protocol like this on a vhost's ws-protocols section - - "lws-server-status": { - "status": "ok", - "update-ms": "5000" - } - +``` + "lws-server-status": { + "status": "ok", + "update-ms": "5000" + } +``` "update-ms" is used to control how often updated JSON is sent on a ws link. And map the provided HTML into the vhost in the mounts section - - { - "mountpoint": "/server-status", - "origin": "file:///usr/local/share/libwebsockets-test-server/server-status", - "default": "server-status.html" - } - +``` + { + "mountpoint": "/server-status", + "origin": "file:///usr/local/share/libwebsockets-test-server/server-status", + "default": "server-status.html" + } +``` You might choose to put it on its own vhost which has "interface": "lo", so it's not externally visible. @@ -406,19 +385,17 @@ Integration with Systemd ------------------------ lwsws needs a service file like this as `/usr/lib/systemd/system/lwsws.service` - ``` -[Unit] -Description=Libwebsockets Web Server -After=syslog.target - -[Service] -ExecStart=/usr/local/bin/lwsws -StandardError=null - -[Install] -WantedBy=multi-user.target - + [Unit] + Description=Libwebsockets Web Server + After=syslog.target + + [Service] + ExecStart=/usr/local/bin/lwsws + StandardError=null + + [Install] + WantedBy=multi-user.target ``` You can find this prepared in `./lwsws/usr-lib-systemd-system-lwsws.service` @@ -429,21 +406,19 @@ Integration with logrotate For correct operation with logrotate, `/etc/logrotate.d/lwsws` (if that's where we're putting the logs) should contain - ``` -/var/log/lwsws/*log { - copytruncate - missingok - notifempty - delaycompress -} + /var/log/lwsws/*log { + copytruncate + missingok + notifempty + delaycompress + } ``` - You can find this prepared in `/lwsws/etc-logrotate.d-lwsws` Prepare the log directory like this ``` -sudo mkdir /var/log/lwsws -sudo chmod 700 /var/log/lwsws + sudo mkdir /var/log/lwsws + sudo chmod 700 /var/log/lwsws ``` diff --git a/README.md b/README.md index ec24329a..d640c61d 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,8 @@ You can get the latest version of the library from git: - https://github.com/warmcat/libwebsockets - https://libwebsockets.org/git -for more information: +Doxygen API docs for master: https://libwebsockets.org/lws-api-doc-master/html/index.html -- [README.build.md](README.build.md) - information on building the library -- [README.coding.md](README.coding.md) - information for writing code using the library -- [README.test-apps.md](README.test-apps.md) - information about the test apps built with the library After libwebsockets 1.3, tags will be signed using a key corresponding to this public key diff --git a/README.test-apps.md b/README.test-apps.md index 3b76052a..240011b8 100644 --- a/README.test-apps.md +++ b/README.test-apps.md @@ -1,10 +1,13 @@ +Notes about lws test apps +========================= + Testing server with a browser ----------------------------- If you run [libwebsockets-test-server](test-server/test-server.c) and point your browser (eg, Chrome) to - http://127.0.0.1:7681 + http://127.0.0.1:7681 It will fetch a script in the form of `test.html`, and then run the script in there on the browser to open a websocket connection. @@ -26,11 +29,9 @@ of the master process, and deletes this file when the master process terminates. To stop the daemon, do - -```bash -$ kill `cat /tmp/.lwsts-lock` ``` - + $ kill cat /tmp/.lwsts-lock +``` If it finds a stale lock (the pid mentioned in the file does not exist any more) it will delete the lock and create a new one during startup. @@ -42,15 +43,13 @@ Using SSL on the server side ---------------------------- To test it using SSL/WSS, just run the test server with - -```bash -$ libwebsockets-test-server --ssl ``` - + $ libwebsockets-test-server --ssl +``` and use the URL - - https://127.0.0.1:7681 - +``` + https://127.0.0.1:7681 +``` The connection will be entirely encrypted using some generated certificates that your browser will not accept, since they are not signed by any real Certificate Authority. Just accept the @@ -68,8 +67,8 @@ Testing websocket client support If you run the test server as described above, you can also connect to it using the test client as well as a browser. -```bash -$ libwebsockets-test-client localhost +``` + $ libwebsockets-test-client localhost ``` will by default connect to the test server on localhost:7681 @@ -80,8 +79,8 @@ same time you will be able to see the circles being drawn. The test client supports SSL too, use -```bash -$ libwebsockets-test-client localhost --ssl -s +``` + $ libwebsockets-test-client localhost --ssl -s ``` the -s tells it to accept the default selfsigned cert from the server, @@ -110,24 +109,20 @@ Testing simple echo You can test against `echo.websockets.org` as a sanity test like this (the client connects to port `80` by default): -```bash -$ libwebsockets-test-echo --client echo.websocket.org +``` + $ libwebsockets-test-echo --client echo.websocket.org ``` This echo test is of limited use though because it doesn't negotiate any protocol. You can run the same test app as a local server, by default on localhost:7681 - -```bash -$ libwebsockets-test-echo ``` - + $ libwebsockets-test-echo +``` and do the echo test against the local echo server - -```bash -$ libwebsockets-test-echo --client localhost --port 7681 ``` - + $ libwebsockets-test-echo --client localhost --port 7681 +``` If you add the `--ssl` switch to both the client and server, you can also test with an encrypted link. @@ -136,11 +131,9 @@ Testing SSL on the client side ------------------------------ To test SSL/WSS client action, just run the client test with - -```bash -$ libwebsockets-test-client localhost --ssl ``` - + $ libwebsockets-test-client localhost --ssl +``` By default the client test applet is set to accept selfsigned certificates used by the test server, this is indicated by the `use_ssl` var being set to `2`. Set it to `1` to reject any server @@ -151,28 +144,26 @@ Using the websocket ping utility -------------------------------- libwebsockets-test-ping connects as a client to a remote -websocket server using 04 protocol and pings it like the +websocket server and pings it like the normal unix ping utility. - -```bash -$ libwebsockets-test-ping localhost -handshake OK for protocol lws-mirror-protocol -Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data. -64 bytes from localhost: req=1 time=0.1ms -64 bytes from localhost: req=2 time=0.1ms -64 bytes from localhost: req=3 time=0.1ms -64 bytes from localhost: req=4 time=0.2ms -64 bytes from localhost: req=5 time=0.1ms -64 bytes from localhost: req=6 time=0.2ms -64 bytes from localhost: req=7 time=0.2ms -64 bytes from localhost: req=8 time=0.1ms -^C ---- localhost.localdomain websocket ping statistics --- -8 packets transmitted, 8 received, 0% packet loss, time 7458ms -rtt min/avg/max = 0.110/0.185/0.218 ms -$ ``` - + $ libwebsockets-test-ping localhost + handshake OK for protocol lws-mirror-protocol + Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data. + 64 bytes from localhost: req=1 time=0.1ms + 64 bytes from localhost: req=2 time=0.1ms + 64 bytes from localhost: req=3 time=0.1ms + 64 bytes from localhost: req=4 time=0.2ms + 64 bytes from localhost: req=5 time=0.1ms + 64 bytes from localhost: req=6 time=0.2ms + 64 bytes from localhost: req=7 time=0.2ms + 64 bytes from localhost: req=8 time=0.1ms + ^C + --- localhost.localdomain websocket ping statistics --- + 8 packets transmitted, 8 received, 0% packet loss, time 7458ms + rtt min/avg/max = 0.110/0.185/0.218 ms + $ +``` By default it sends 64 byte payload packets using the 04 PING packet opcode type. You can change the payload size using the `-s=` flag, up to a maximum of 125 mandated by the @@ -200,41 +191,37 @@ Fraggle test app ---------------- By default it runs in server mode - -```bash -$ libwebsockets-test-fraggle -libwebsockets test fraggle -(C) Copyright 2010-2011 Andy Green licensed under LGPL2.1 - Compiled with SSL support, not using it - Listening on port 7681 -server sees client connect -accepted v06 connection -Spamming 360 random fragments -Spamming session over, len = 371913. sum = 0x2D3C0AE -Spamming 895 random fragments -Spamming session over, len = 875970. sum = 0x6A74DA1 -... ``` - + $ libwebsockets-test-fraggle + libwebsockets test fraggle + (C) Copyright 2010-2011 Andy Green licensed under LGPL2.1 + Compiled with SSL support, not using it + Listening on port 7681 + server sees client connect + accepted v06 connection + Spamming 360 random fragments + Spamming session over, len = 371913. sum = 0x2D3C0AE + Spamming 895 random fragments + Spamming session over, len = 875970. sum = 0x6A74DA1 + ... +``` You need to run a second session in client mode, you have to give the `-c` switch and the server address at least: - -```bash -$ libwebsockets-test-fraggle -c localhost -libwebsockets test fraggle -(C) Copyright 2010-2011 Andy Green licensed under LGPL2.1 - Client mode -Connecting to localhost:7681 -denied deflate-stream extension -handshake OK for protocol fraggle-protocol -client connects to server -EOM received 371913 correctly from 360 fragments -EOM received 875970 correctly from 895 fragments -EOM received 247140 correctly from 258 fragments -EOM received 695451 correctly from 692 fragments -... ``` - + $ libwebsockets-test-fraggle -c localhost + libwebsockets test fraggle + (C) Copyright 2010-2011 Andy Green licensed under LGPL2.1 + Client mode + Connecting to localhost:7681 + denied deflate-stream extension + handshake OK for protocol fraggle-protocol + client connects to server + EOM received 371913 correctly from 360 fragments + EOM received 875970 correctly from 895 fragments + EOM received 247140 correctly from 258 fragments + EOM received 695451 correctly from 692 fragments + ... +``` The fraggle test sends a random number up to 1024 fragmented websocket frames each of a random size between 1 and 2001 bytes in a single message, then sends a checksum and starts sending a new randomly sized and fragmented message. @@ -252,12 +239,10 @@ connection code for both `ws://` and `wss://`. It doesn't support authentication. You use it like this - -```bash -$ export http_proxy=myproxy.com:3128 -$ libwebsockets-test-client someserver.com ``` - + $ export http_proxy=myproxy.com:3128 + $ libwebsockets-test-client someserver.com +``` debug logging ------------- diff --git a/doc/html/annotated.html b/doc/html/annotated.html new file mode 100644 index 00000000..ebb55032 --- /dev/null +++ b/doc/html/annotated.html @@ -0,0 +1,118 @@ + + + + + + +libwebsockets: Data Structures + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + +
+
+ +
+
+
+ + + + + + diff --git a/doc/html/annotated_dup.js b/doc/html/annotated_dup.js new file mode 100644 index 00000000..cf2a419b --- /dev/null +++ b/doc/html/annotated_dup.js @@ -0,0 +1,30 @@ +var annotated_dup = +[ + [ "lws_cgi_args", "structlws__cgi__args.html", "structlws__cgi__args" ], + [ "lws_client_connect_info", "structlws__client__connect__info.html", "structlws__client__connect__info" ], + [ "lws_conn", "classlws__conn.html", "classlws__conn" ], + [ "lws_conn_listener", "classlws__conn__listener.html", "classlws__conn__listener" ], + [ "lws_context_creation_info", "structlws__context__creation__info.html", "structlws__context__creation__info" ], + [ "lws_email", "structlws__email.html", "structlws__email" ], + [ "lws_ext_option_arg", "structlws__ext__option__arg.html", "structlws__ext__option__arg" ], + [ "lws_ext_options", "structlws__ext__options.html", "structlws__ext__options" ], + [ "lws_extension", "structlws__extension.html", "structlws__extension" ], + [ "lws_gs_event_args", "structlws__gs__event__args.html", "structlws__gs__event__args" ], + [ "lws_http_mount", "structlws__http__mount.html", "structlws__http__mount" ], + [ "lws_plat_file_ops", "structlws__plat__file__ops.html", "structlws__plat__file__ops" ], + [ "lws_plugin", "structlws__plugin.html", "structlws__plugin" ], + [ "lws_plugin_capability", "structlws__plugin__capability.html", "structlws__plugin__capability" ], + [ "lws_polarssl_context", "structlws__polarssl__context.html", "structlws__polarssl__context" ], + [ "lws_pollargs", "structlws__pollargs.html", "structlws__pollargs" ], + [ "lws_pollfd", "structlws__pollfd.html", "structlws__pollfd" ], + [ "lws_process_html_args", "structlws__process__html__args.html", "structlws__process__html__args" ], + [ "lws_process_html_state", "structlws__process__html__state.html", "structlws__process__html__state" ], + [ "lws_protocol_vhost_options", "structlws__protocol__vhost__options.html", "structlws__protocol__vhost__options" ], + [ "lws_protocols", "structlws__protocols.html", "structlws__protocols" ], + [ "lws_session_info", "structlws__session__info.html", "structlws__session__info" ], + [ "lws_token_limits", "structlws__token__limits.html", "structlws__token__limits" ], + [ "lws_tokens", "structlws__tokens.html", "structlws__tokens" ], + [ "lwsgw_hash", "structlwsgw__hash.html", "structlwsgw__hash" ], + [ "lwsgw_hash_bin", "structlwsgw__hash__bin.html", "structlwsgw__hash__bin" ], + [ "pollfd", "structpollfd.html", "structpollfd" ] +]; \ No newline at end of file diff --git a/doc/html/arrowdown.png b/doc/html/arrowdown.png new file mode 100644 index 0000000000000000000000000000000000000000..0b63f6d38c4b9ec907b820192ebe9724ed6eca22 GIT binary patch literal 246 zcmVkw!R34#Lv2LOS^S2tZA31X++9RY}n zChwn@Z)Wz*WWHH{)HDtJnq&A2hk$b-y(>?@z0iHr41EKCGp#T5?07*qoM6N<$f(V3Pvj6}9 literal 0 HcmV?d00001 diff --git a/doc/html/arrowright.png b/doc/html/arrowright.png new file mode 100644 index 0000000000000000000000000000000000000000..c6ee22f937a07d1dbfc27c669d11f8ed13e2f152 GIT binary patch literal 229 zcmV^P)R?RzRoKvklcaQ%HF6%rK2&ZgO(-ihJ_C zzrKgp4jgO( fd_(yg|3PpEQb#9`a?Pz_00000NkvXXu0mjftR`5K literal 0 HcmV?d00001 diff --git a/doc/html/bc_s.png b/doc/html/bc_s.png new file mode 100644 index 0000000000000000000000000000000000000000..224b29aa9847d5a4b3902efd602b7ddf7d33e6c2 GIT binary patch literal 676 zcmV;V0$crwP)y__>=_9%My z{n931IS})GlGUF8K#6VIbs%684A^L3@%PlP2>_sk`UWPq@f;rU*V%rPy_ekbhXT&s z(GN{DxFv}*vZp`F>S!r||M`I*nOwwKX+BC~3P5N3-)Y{65c;ywYiAh-1*hZcToLHK ztpl1xomJ+Yb}K(cfbJr2=GNOnT!UFA7Vy~fBz8?J>XHsbZoDad^8PxfSa0GDgENZS zuLCEqzb*xWX2CG*b&5IiO#NzrW*;`VC9455M`o1NBh+(k8~`XCEEoC1Ybwf;vr4K3 zg|EB<07?SOqHp9DhLpS&bzgo70I+ghB_#)K7H%AMU3v}xuyQq9&Bm~++VYhF09a+U zl7>n7Jjm$K#b*FONz~fj;I->Bf;ule1prFN9FovcDGBkpg>)O*-}eLnC{6oZHZ$o% zXKW$;0_{8hxHQ>l;_*HATI(`7t#^{$(zLe}h*mqwOc*nRY9=?Sx4OOeVIfI|0V(V2 zBrW#G7Ss9wvzr@>H*`r>zE z+e8bOBgqIgldUJlG(YUDviMB`9+DH8n-s9SXRLyJHO1!=wY^79WYZMTa(wiZ!zP66 zA~!21vmF3H2{ngD;+`6j#~6j;$*f*G_2ZD1E;9(yaw7d-QnSCpK(cR1zU3qU0000< KMNUMnLSTYoA~SLT literal 0 HcmV?d00001 diff --git a/doc/html/bdwn.png b/doc/html/bdwn.png new file mode 100644 index 0000000000000000000000000000000000000000..940a0b950443a0bb1b216ac03c45b8a16c955452 GIT binary patch literal 147 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)H!3HEvS)PKZC{Gv1kP61Pb5HX&C2wk~_T + + + + + +libwebsockets: Data Structure Index + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + +
+
+ +
+
+
+ + + + + + diff --git a/doc/html/classlws__conn.html b/doc/html/classlws__conn.html new file mode 100644 index 00000000..66908a7c --- /dev/null +++ b/doc/html/classlws__conn.html @@ -0,0 +1,143 @@ + + + + + + +libwebsockets: lws_conn Class Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + +
+
+ +
+
+
+ +
+
+ +
+
lws_conn Class Reference
+
+
+
+Inheritance diagram for lws_conn:
+
+
+ + +lws_conn_listener + +
+ + + + + + + + + + + + + + + + +

+Public Member Functions

+void set_wsi (struct lws *_wsi)
 
+int actual_onRX (Socket *s)
 
+void onRX (Socket *s)
 
+void onError (Socket *s, socket_error_t err)
 
+void onDisconnect (TCPStream *s)
 
+void onSent (Socket *s, uint16_t len)
 
+void serialized_writeable (struct lws *wsi)
 
+ + + + + + + + + +

+Data Fields

+TCPStream * ts
 
+struct lws * wsi
 
+char writeable
 
+char awaiting_on_writeable
 
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/doc/html/classlws__conn.js b/doc/html/classlws__conn.js new file mode 100644 index 00000000..9f3de47c --- /dev/null +++ b/doc/html/classlws__conn.js @@ -0,0 +1,15 @@ +var classlws__conn = +[ + [ "lws_conn", "classlws__conn.html#af0e213af91d53d1e1aef70ed7816191f", null ], + [ "actual_onRX", "classlws__conn.html#aef530971372f55e862f2e09bc98f1029", null ], + [ "onDisconnect", "classlws__conn.html#a49f87612c6a3098cd1587f8382b8c85b", null ], + [ "onError", "classlws__conn.html#a4fb477fad697ce1faf8ec7a884ea6c6b", null ], + [ "onRX", "classlws__conn.html#aba42bdd763a36c3a331b62410969b6ba", null ], + [ "onSent", "classlws__conn.html#aad7d2406618e560114650a91c729a596", null ], + [ "serialized_writeable", "classlws__conn.html#accc57581269c554291dac840ed135231", null ], + [ "set_wsi", "classlws__conn.html#afe73e53da2070f659ad6e7fd14878c7e", null ], + [ "awaiting_on_writeable", "classlws__conn.html#a5226010afdf5421f279454e5cbb282a4", null ], + [ "ts", "classlws__conn.html#a5cad031b6b779da42b37f4007cae541b", null ], + [ "writeable", "classlws__conn.html#a8e1fdd467b7f66fc438dc70ae979b938", null ], + [ "wsi", "classlws__conn.html#a7e504bd449ffb51c7ab1d2126613ebc3", null ] +]; \ No newline at end of file diff --git a/doc/html/classlws__conn.png b/doc/html/classlws__conn.png new file mode 100644 index 0000000000000000000000000000000000000000..12fbdb2199c7eb95f5379b04247384353b76c322 GIT binary patch literal 480 zcmeAS@N?(olHy`uVBq!ia0vp^g+Ls@!3-oN1F}FIi2$Dv*Z=?j1DP-0d@b!iGy%v0 z;{yi{uy)>&2XZ+|g8YIRfQmri>ZuST1_s7_PZ!6K3dXl{A5Lmk;9;BIzwf{C{IE5h zVq0Zrt(J8ww=mtI^5j)~ke8;2kb}ZqjtjH&P0Zpigi9T7IP~Fs$~>R&%LXko85bP$ zK6dftBz^N!QPY5&nX7IU2fv&8qe4E;XxF6LYZkKmCfa3|>fIi_#psR&NAuK=ZVefA_J`*wAJD&0 z%(BDI*1h5NWhBOmiN)s@PEggHkT+$?wLgmuJul7XDVD#?fB*8SA7Ao4Zzc33=P2$h zhq&|LbBlYs+;?6${%6ySvG$<_ZlC!t;##K%SU_T>iKiGb{Z~S zEqz_pI(^P-+i8XC4i<$P`nBgbd_ET1>9eAC@$1mr)>~`utX*~g_~TW2{NJj+u2{7! z{Q2#r;rri*zuWg%FVeGU4#z|l|NmtkLD{ + + + + + +libwebsockets: lws_conn_listener Class Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + +
+
+ +
+
+
+ +
+
+ +
+
lws_conn_listener Class Reference
+
+
+
+Inheritance diagram for lws_conn_listener:
+
+
+ + +lws_conn + +
+ + + + +

+Public Member Functions

void start (const uint16_t port)
 
+ + + +

+Data Fields

+TCPListener srv
 
+ + + + + + + + + +

+Protected Member Functions

void onRX (Socket *s)
 
void onError (Socket *s, socket_error_t err)
 
void onIncoming (TCPListener *s, void *impl)
 
void onDisconnect (TCPStream *s)
 
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
void lws_conn_listener::onDisconnect (TCPStream * s)
+
+protected
+
+

disconnection

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void lws_conn_listener::onError (Socket * s,
socket_error_t err 
)
+
+protected
+
+

if error occurs

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void lws_conn_listener::onIncoming (TCPListener * s,
void * impl 
)
+
+protected
+
+

new connection

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void lws_conn_listener::onRX (Socket * s)
+
+protected
+
+

incoming data ready

+ +
+
+ +
+
+ + + + + + + + +
void lws_conn_listener::start (const uint16_t port)
+
+

start listening

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/doc/html/classlws__conn__listener.js b/doc/html/classlws__conn__listener.js new file mode 100644 index 00000000..d70bc4d8 --- /dev/null +++ b/doc/html/classlws__conn__listener.js @@ -0,0 +1,10 @@ +var classlws__conn__listener = +[ + [ "lws_conn_listener", "classlws__conn__listener.html#ac82c8696a36a2f386b4094490d300dee", null ], + [ "onDisconnect", "classlws__conn__listener.html#aab3c7bf550a8f15d20f1e093125c2e60", null ], + [ "onError", "classlws__conn__listener.html#a271ac4f8ad5770b3bc96cce5b265b72c", null ], + [ "onIncoming", "classlws__conn__listener.html#ab432a456c3a961ec562e06141897806b", null ], + [ "onRX", "classlws__conn__listener.html#ab3bc839797ba14554ac70ad09fd155c7", null ], + [ "start", "classlws__conn__listener.html#a3c19c314f2ea2b758407b4041e4c4010", null ], + [ "srv", "classlws__conn__listener.html#aa7076f8965bb9df268798fd9a0283374", null ] +]; \ No newline at end of file diff --git a/doc/html/classlws__conn__listener.png b/doc/html/classlws__conn__listener.png new file mode 100644 index 0000000000000000000000000000000000000000..d073243527727b29f62b3f16eda3c8633a82ca08 GIT binary patch literal 477 zcmeAS@N?(olHy`uVBq!ia0vp^g+Ls@!3-oN1F}FIi2$Dv*Z=?j1DP-0d@b!iGy%v0 z;{yi{uy)>&2XZ+|g8YIRfQmri>ZuST1_s6)PZ!6K3dXl{AC@&M@VM#A@B44ezx%| z{lbzdX8t_o17BYvF|K%ME)DQtXe?27$o_Znhj`)4>e+P_bHk49KF(m>Q)n|olfSn* z;rhasnFpU+%=^__v~c^+%`ewo40~B7{Ce-2X5(9T+w`s%Ec&}9cBWZUxV?3@c(PZx zd7gLKxgA%ktMX@sOjo*Z>^D2V;qx)yPM;Nf7rhR>4f07u=>ERrp|SN9S5~`+n(o~- zXI}N!&-aQ>U*}nHs8fK!|9=_7mSxh6QO0#aL0*~@1|%O$WD@{V-kvUwAr*{o@8{^CZMh(5KoB^r_<4^zF@3)Cp&&t3hdujKf f*?bjBoY!V+E))@{xMcbjXe@)LtDnm{r-UW|*e5JT literal 0 HcmV?d00001 diff --git a/doc/html/deprecated.html b/doc/html/deprecated.html new file mode 100644 index 00000000..02ac973a --- /dev/null +++ b/doc/html/deprecated.html @@ -0,0 +1,87 @@ + + + + + + +libwebsockets: Deprecated List + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+
+
Deprecated List
+
+
+
+
Global lws_client_connect (struct lws_context *clients, const char *address, int port, int ssl_connection, const char *path, const char *host, const char *origin, const char *protocol, int ietf_version_or_minus_one) LWS_WARN_DEPRECATED
+
DEPRECATED use lws_client_connect_via_info
+
Global lws_client_connect_extended (struct lws_context *clients, const char *address, int port, int ssl_connection, const char *path, const char *host, const char *origin, const char *protocol, int ietf_version_or_minus_one, void *userdata) LWS_WARN_DEPRECATED
+
DEPRECATED use lws_client_connect_via_info
+
Global lws_vhost_get (struct lws *wsi) LWS_WARN_DEPRECATED
+
deprecated: use lws_get_vhost()
+
+
+
+ + + + diff --git a/doc/html/dir_97aefd0d527b934f1d99a682da8fe6a9.html b/doc/html/dir_97aefd0d527b934f1d99a682da8fe6a9.html new file mode 100644 index 00000000..097ee504 --- /dev/null +++ b/doc/html/dir_97aefd0d527b934f1d99a682da8fe6a9.html @@ -0,0 +1,92 @@ + + + + + + +libwebsockets: lib Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + +
+
+ +
+
+
+ +
+
+
+
lib Directory Reference
+
+
+ + + + +

+Files

file  libwebsockets.h [code]
 
+
+
+ + + + diff --git a/doc/html/dir_97aefd0d527b934f1d99a682da8fe6a9.js b/doc/html/dir_97aefd0d527b934f1d99a682da8fe6a9.js new file mode 100644 index 00000000..b6b50a25 --- /dev/null +++ b/doc/html/dir_97aefd0d527b934f1d99a682da8fe6a9.js @@ -0,0 +1,4 @@ +var dir_97aefd0d527b934f1d99a682da8fe6a9 = +[ + [ "libwebsockets.h", "libwebsockets_8h.html", "libwebsockets_8h" ] +]; \ No newline at end of file diff --git a/doc/html/doc.png b/doc/html/doc.png new file mode 100644 index 0000000000000000000000000000000000000000..17edabff95f7b8da13c9516a04efe05493c29501 GIT binary patch literal 746 zcmV7=@pnbNXRFEm&G8P!&WHG=d)>K?YZ1bzou)2{$)) zumDct!>4SyxL;zgaG>wy`^Hv*+}0kUfCrz~BCOViSb$_*&;{TGGn2^x9K*!Sf0=lV zpP=7O;GA0*Jm*tTYj$IoXvimpnV4S1Z5f$p*f$Db2iq2zrVGQUz~yq`ahn7ck(|CE z7Gz;%OP~J6)tEZWDzjhL9h2hdfoU2)Nd%T<5Kt;Y0XLt&<@6pQx!nw*5`@bq#?l*?3z{Hlzoc=Pr>oB5(9i6~_&-}A(4{Q$>c>%rV&E|a(r&;?i5cQB=} zYSDU5nXG)NS4HEs0it2AHe2>shCyr7`6@4*6{r@8fXRbTA?=IFVWAQJL&H5H{)DpM#{W(GL+Idzf^)uRV@oB8u$ z8v{MfJbTiiRg4bza<41NAzrl{=3fl_D+$t+^!xlQ8S}{UtY`e z;;&9UhyZqQRN%2pot{*Ei0*4~hSF_3AH2@fKU!$NSflS>{@tZpDT4`M2WRTTVH+D? z)GFlEGGHe?koB}i|1w45!BF}N_q&^HJ&-tyR{(afC6H7|aml|tBBbv}55C5DNP8p3 z)~jLEO4Z&2hZmP^i-e%(@d!(E|KRafiU8Q5u(wU((j8un3OR*Hvj+t literal 0 HcmV?d00001 diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css new file mode 100644 index 00000000..1425ec53 --- /dev/null +++ b/doc/html/doxygen.css @@ -0,0 +1,1475 @@ +/* The standard CSS for doxygen 1.8.11 */ + +body, table, div, p, dl { + font: 400 14px/22px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 4px 6px; + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +div.ah, span.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: bold; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #9CAFD4; + border-bottom: 1px solid #9CAFD4; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +.arrow { + color: #9CAFD4; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial, Helvetica; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #728DC1; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('doc.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +table.directory { + font: 400 14px Roboto,sans-serif; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section +{ + margin-left: 0px; + padding-left: 0px; +} + +dl.note +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00D000; +} + +dl.deprecated +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #505050; +} + +dl.todo +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00C0E0; +} + +dl.test +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #3030E0; +} + +dl.bug +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + diff --git a/doc/html/doxygen.png b/doc/html/doxygen.png new file mode 100644 index 0000000000000000000000000000000000000000..3ff17d807fd8aa003bed8bb2a69e8f0909592fd1 GIT binary patch literal 3779 zcmV;!4m|ORP)tMIv#Q0*~7*`IBSO7_x;@a8#Zk6_PeKR_s92J&)(m+);m9Iz3blw)z#Gi zP!9lj4$%+*>Hz@HCmM9L9|8c+0u=!H$O3?R0Kgx|#WP<6fKfC8fM-CQZT|_r@`>VO zX^Hgb|9cJqpdJA5$MCEK`F_2@2Y@s>^+;pF`~jdI0Pvr|vl4`=C)EH@1IFe7pdJ8F zH(qGi004~QnF)Ggga~8v08kGAs2hKTATxr7pwfNk|4#_AaT>w8P6TV+R2kbS$v==} zAjf`s0g#V8lB+b3)5oEI*q+{Yt$MZDruD2^;$+(_%Qn+%v0X-bJO=;@kiJ^ygLBnC z?1OVv_%aex1M@jKU|Z~$eI?PoF4Vj>fDzyo zAiLfpXY*a^Sj-S5D0S3@#V$sRW)g)_1e#$%8xdM>Jm7?!h zu0P2X=xoN>^!4DoPRgph2(2va07yfpXF+WH7EOg1GY%Zn z7~1A<(z7Q$ktEXhW_?GMpHp9l_UL18F3KOsxu81pqoBiNbFSGsof-W z6~eloMoz=4?OOnl2J268x5rOY`dCk0us(uS#Ud4yqOr@?=Q57a}tit|BhY>}~frH1sP`ScHS_d)oqH^lYy zZ%VP`#10MlE~P?cE(%(#(AUSv_T{+;t@$U}El}(1ig`vZo`Rm;+5&(AYzJ^Ae=h2X z@Re%vHwZU>|f0NI&%$*4eJweC5OROQrpPMA@*w|o z()A==l}(@bv^&>H1Ob3C=<^|hob?0+xJ?QQ3-ueQC}zy&JQNib!OqSO@-=>XzxlSF zAZ^U*1l6EEmg3r};_HY>&Jo_{dOPEFTWPmt=U&F#+0(O59^UIlHbNX+eF8UzyDR*T z(=5X$VF3!gm@RooS-&iiUYGG^`hMR(07zr_xP`d!^BH?uD>Phl8Rdifx3Af^Zr`Ku ztL+~HkVeL#bJ)7;`=>;{KNRvjmc}1}c58Sr#Treq=4{xo!ATy|c>iRSp4`dzMMVd@ zL8?uwXDY}Wqgh4mH`|$BTXpUIu6A1-cSq%hJw;@^Zr8TP=GMh*p(m(tN7@!^D~sl$ zz^tf4II4|};+irE$Fnm4NTc5%p{PRA`%}Zk`CE5?#h3|xcyQsS#iONZ z6H(@^i9td!$z~bZiJLTax$o>r(p}3o@< zyD7%(>ZYvy=6$U3e!F{Z`uSaYy`xQyl?b{}eg|G3&fz*`QH@mDUn)1%#5u`0m$%D} z?;tZ0u(mWeMV0QtzjgN!lT*pNRj;6510Wwx?Yi_=tYw|J#7@(Xe7ifDzXuK;JB;QO z#bg~K$cgm$@{QiL_3yr}y&~wuv=P=#O&Tj=Sr)aCUlYmZMcw?)T?c%0rUe1cS+o!qs_ zQ6Gp)-{)V!;=q}llyK3|^WeLKyjf%y;xHku;9(vM!j|~<7w1c*Mk-;P{T&yG) z@C-8E?QPynNQ<8f01D`2qexcVEIOU?y}MG)TAE6&VT5`rK8s(4PE;uQ92LTXUQ<>^ ztyQ@=@kRdh@ebUG^Z6NWWIL;_IGJ2ST>$t!$m$qvtj0Qmw8moN6GUV^!QKNK zHBXCtUH8)RY9++gH_TUV4^=-j$t}dD3qsN7GclJ^Zc&(j6&a_!$jCf}%c5ey`pm~1)@{yI3 zTdWyB+*X{JFw#z;PwRr5evb2!ueWF;v`B0HoUu4-(~aL=z;OXUUEtG`_$)Oxw6FKg zEzY`CyKaSBK3xt#8gA|r_|Kehn_HYVBMpEwbn9-fI*!u*eTA1ef8Mkl1=!jV4oYwWYM}i`A>_F4nhmlCIC6WLa zY%;4&@AlnaG11ejl61Jev21|r*m+?Kru3;1tFDl}#!OzUp6c>go4{C|^erwpG*&h6bspUPJag}oOkN2912Y3I?(eRc@U9>z#HPBHC?nps7H5!zP``90!Q1n80jo+B3TWXp!8Pe zwuKuLLI6l3Gv@+QH*Y}2wPLPQ1^EZhT#+Ed8q8Wo z1pTmIBxv14-{l&QVKxAyQF#8Q@NeJwWdKk>?cpiJLkJr+aZ!Me+Cfp!?FWSRf^j2k z73BRR{WSKaMkJ>1Nbx5dan5hg^_}O{Tj6u%iV%#QGz0Q@j{R^Ik)Z*+(YvY2ziBG)?AmJa|JV%4UT$k`hcOg5r9R?5>?o~JzK zJCrj&{i#hG>N7!B4kNX(%igb%kDj0fOQThC-8mtfap82PNRXr1D>lbgg)dYTQ(kbx z`Ee5kXG~Bh+BHQBf|kJEy6(ga%WfhvdQNDuOfQoe377l#ht&DrMGeIsI5C<&ai zWG$|hop2@@q5YDa)_-A?B02W;#fH!%k`daQLEItaJJ8Yf1L%8x;kg?)k)00P-lH+w z)5$QNV6r2$YtnV(4o=0^3{kmaXn*Dm0F*fU(@o)yVVjk|ln8ea6BMy%vZAhW9|wvA z8RoDkVoMEz1d>|5(k0Nw>22ZT){V<3$^C-cN+|~hKt2)){+l-?3m@-$c?-dlzQ)q- zZ)j%n^gerV{|+t}9m1_&&Ly!9$rtG4XX|WQ8`xYzGC~U@nYh~g(z9)bdAl#xH)xd5a=@|qql z|FzEil{P5(@gy!4ek05i$>`E^G~{;pnf6ftpLh$h#W?^#4UkPfa;;?bsIe&kz!+40 zI|6`F2n020)-r`pFaZ38F!S-lJM-o&inOw|66=GMeP@xQU5ghQH{~5Uh~TMTd;I9` z>YhVB`e^EVj*S7JF39ZgNf}A-0DwOcTT63ydN$I3b?yBQtUI*_fae~kPvzoD$zjX3 zoqBe#>12im4WzZ=f^4+u=!lA|#r%1`WB0-6*3BL#at`47#ebPpR|D1b)3BjT34nYY z%Ds%d?5$|{LgOIaRO{{oC&RK`O91$fqwM0(C_TALcozu*fWHb%%q&p-q{_8*2Zsi^ zh1ZCnr^UYa;4vQEtHk{~zi>wwMC5o{S=$P0X681y`SXwFH?Ewn{x-MOZynmc)JT5v zuHLwh;tLfxRrr%|k370}GofLl7thg>ACWWY&msqaVu&ry+`7+Ss>NL^%T1|z{IGMA zW-SKl=V-^{(f!Kf^#3(|T2W47d(%JVCI4JgRrT1pNz>+ietmFToNv^`gzC@&O-)+i zPQ~RwK8%C_vf%;%e>NyTp~dM5;!C|N0Q^6|CEb7Bw=Vz~$1#FA;Z*?mKSC)Hl-20s t8QyHj(g6VK0RYbl8UjE)0O0w=e*@m04r>stuEhWV002ovPDHLkV1hl;dM*F} literal 0 HcmV?d00001 diff --git a/doc/html/dynsections.js b/doc/html/dynsections.js new file mode 100644 index 00000000..85e18369 --- /dev/null +++ b/doc/html/dynsections.js @@ -0,0 +1,97 @@ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + + +libwebsockets: File List + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + +
+
+ +
+
+
+ +
+
+
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+
[detail level 12]
+ + +
  lib
 libwebsockets.h
+
+
+
+ + + + diff --git a/doc/html/files.js b/doc/html/files.js new file mode 100644 index 00000000..47a213c1 --- /dev/null +++ b/doc/html/files.js @@ -0,0 +1,4 @@ +var files = +[ + [ "lib", "dir_97aefd0d527b934f1d99a682da8fe6a9.html", "dir_97aefd0d527b934f1d99a682da8fe6a9" ] +]; \ No newline at end of file diff --git a/doc/html/folderclosed.png b/doc/html/folderclosed.png new file mode 100644 index 0000000000000000000000000000000000000000..bb8ab35edce8e97554e360005ee9fc5bffb36e66 GIT binary patch literal 616 zcmV-u0+;=XP)a9#ETzayK)T~Jw&MMH>OIr#&;dC}is*2Mqdf&akCc=O@`qC+4i z5Iu3w#1M@KqXCz8TIZd1wli&kkl2HVcAiZ8PUn5z_kG@-y;?yK06=cA0U%H0PH+kU zl6dp}OR(|r8-RG+YLu`zbI}5TlOU6ToR41{9=uz^?dGTNL;wIMf|V3`d1Wj3y!#6` zBLZ?xpKR~^2x}?~zA(_NUu3IaDB$tKma*XUdOZN~c=dLt_h_k!dbxm_*ibDM zlFX`g{k$X}yIe%$N)cn1LNu=q9_CS)*>A zsX_mM4L@`(cSNQKMFc$RtYbx{79#j-J7hk*>*+ZZhM4Hw?I?rsXCi#mRWJ=-0LGV5a-WR0Qgt<|Nqf)C-@80`5gIz45^_20000IqP)X=#(TiCT&PiIIVc55T}TU}EUh*{q$|`3@{d>{Tc9Bo>e= zfmF3!f>fbI9#GoEHh0f`i5)wkLpva0ztf%HpZneK?w-7AK@b4Itw{y|Zd3k!fH?q2 zlhckHd_V2M_X7+)U&_Xcfvtw60l;--DgZmLSw-Y?S>)zIqMyJ1#FwLU*%bl38ok+! zh78H87n`ZTS;uhzAR$M`zZ`bVhq=+%u9^$5jDplgxd44}9;IRqUH1YHH|@6oFe%z( zo4)_>E$F&^P-f(#)>(TrnbE>Pefs9~@iN=|)Rz|V`sGfHNrJ)0gJb8xx+SBmRf@1l zvuzt=vGfI)<-F9!o&3l?>9~0QbUDT(wFdnQPv%xdD)m*g%!20>Bc9iYmGAp<9YAa( z0QgYgTWqf1qN++Gqp z8@AYPTB3E|6s=WLG?xw0tm|U!o=&zd+H0oRYE;Dbx+Na9s^STqX|Gnq%H8s(nGDGJ j8vwW|`Ts`)fSK|Kx=IK@RG@g200000NkvXXu0mjfauFEA literal 0 HcmV?d00001 diff --git a/doc/html/functions.html b/doc/html/functions.html new file mode 100644 index 00000000..822d3ceb --- /dev/null +++ b/doc/html/functions.html @@ -0,0 +1,654 @@ + + + + + + +libwebsockets: Data Fields + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:
+ +

- _ -

+ + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- k -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+ + +

- w -

+
+
+ + + + diff --git a/doc/html/functions_func.html b/doc/html/functions_func.html new file mode 100644 index 00000000..c9b61310 --- /dev/null +++ b/doc/html/functions_func.html @@ -0,0 +1,107 @@ + + + + + + +libwebsockets: Data Fields - Functions + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html new file mode 100644 index 00000000..90979a6d --- /dev/null +++ b/doc/html/functions_vars.html @@ -0,0 +1,641 @@ + + + + + + +libwebsockets: Data Fields - Variables + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+  + +

- _ -

+ + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- k -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+ + +

- w -

+
+
+ + + + diff --git a/doc/html/globals.html b/doc/html/globals.html new file mode 100644 index 00000000..f8b0cda1 --- /dev/null +++ b/doc/html/globals.html @@ -0,0 +1,109 @@ + + + + + + +libwebsockets: Globals + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
+ +

- e -

+
+
+ + + + diff --git a/doc/html/globals_dup.js b/doc/html/globals_dup.js new file mode 100644 index 00000000..b86a86b4 --- /dev/null +++ b/doc/html/globals_dup.js @@ -0,0 +1,5 @@ +var globals_dup = +[ + [ "e", "globals.html", null ], + [ "l", "globals_l.html", null ] +]; \ No newline at end of file diff --git a/doc/html/globals_enum.html b/doc/html/globals_enum.html new file mode 100644 index 00000000..fc5d51d0 --- /dev/null +++ b/doc/html/globals_enum.html @@ -0,0 +1,122 @@ + + + + + + +libwebsockets: Globals + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/globals_eval.html b/doc/html/globals_eval.html new file mode 100644 index 00000000..7425730e --- /dev/null +++ b/doc/html/globals_eval.html @@ -0,0 +1,419 @@ + + + + + + +libwebsockets: Globals + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+  + +

- e -

+ + +

- l -

+
+
+ + + + diff --git a/doc/html/globals_func.html b/doc/html/globals_func.html new file mode 100644 index 00000000..4dfdcb1d --- /dev/null +++ b/doc/html/globals_func.html @@ -0,0 +1,423 @@ + + + + + + +libwebsockets: Globals + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+  + +

- l -

+
+
+ + + + diff --git a/doc/html/globals_l.html b/doc/html/globals_l.html new file mode 100644 index 00000000..a974eb8c --- /dev/null +++ b/doc/html/globals_l.html @@ -0,0 +1,769 @@ + + + + + + +libwebsockets: Globals + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
+ +

- l -

+
+
+ + + + diff --git a/doc/html/globals_type.html b/doc/html/globals_type.html new file mode 100644 index 00000000..118acaf5 --- /dev/null +++ b/doc/html/globals_type.html @@ -0,0 +1,101 @@ + + + + + + +libwebsockets: Globals + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__HTTP-headers-create.html b/doc/html/group__HTTP-headers-create.html new file mode 100644 index 00000000..c8f19c82 --- /dev/null +++ b/doc/html/group__HTTP-headers-create.html @@ -0,0 +1,377 @@ + + + + + + +libwebsockets: HTTP headers: create + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
HTTP headers: create
+
+
+ + + + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_add_http_header_status (struct lws *wsi, unsigned int code, unsigned char **p, unsigned char *end)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_add_http_header_by_name (struct lws *wsi, const unsigned char *name, const unsigned char *value, int length, unsigned char **p, unsigned char *end)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_add_http_header_by_token (struct lws *wsi, enum lws_token_indexes token, const unsigned char *value, int length, unsigned char **p, unsigned char *end)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_add_http_header_content_length (struct lws *wsi, unsigned long content_length, unsigned char **p, unsigned char *end)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_finalize_http_header (struct lws *wsi, unsigned char **p, unsigned char *end)
 
+

Detailed Description

+

HTTP headers: Create

+

These apis allow you to create HTTP response headers in a way compatible with both HTTP/1.x and HTTP/2.

+

They each append to a buffer taking care about the buffer end, which is passed in as a pointer. When data is written to the buffer, the current position p is updated accordingly.

+

All of these apis are LWS_WARN_UNUSED_RESULT as they can run out of space and fail with nonzero return.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_add_http_header_by_name (struct lws * wsi,
const unsigned char * name,
const unsigned char * value,
int length,
unsigned char ** p,
unsigned char * end 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_add_http_header_by_name() - append named header and value

+
Parameters
+ + + + + + + +
wsithe connection to check
namethe hdr name, like "my-header"
valuethe value after the = for this header
lengththe length of the value
ppointer to current position in buffer pointer
endpointer to end of buffer
+
+
+

Appends name: value to the headers

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_add_http_header_by_token (struct lws * wsi,
enum lws_token_indexes token,
const unsigned char * value,
int length,
unsigned char ** p,
unsigned char * end 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_add_http_header_by_token() - append given header and value

+
Parameters
+ + + + + + + +
wsithe connection to check
tokenthe token index for the hdr
valuethe value after the = for this header
lengththe length of the value
ppointer to current position in buffer pointer
endpointer to end of buffer
+
+
+

Appends name=value to the headers, but is able to take advantage of better HTTP/2 coding mechanisms where possible.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_add_http_header_content_length (struct lws * wsi,
unsigned long content_length,
unsigned char ** p,
unsigned char * end 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_add_http_header_by_name() - append content-length helper

+
Parameters
+ + + + + +
wsithe connection to check
content_lengththe content length to use
ppointer to current position in buffer pointer
endpointer to end of buffer
+
+
+

Appends content-length: content_length to the headers

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_add_http_header_status (struct lws * wsi,
unsigned int code,
unsigned char ** p,
unsigned char * end 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_add_http_header_status() - add the HTTP response status code

+
Parameters
+ + + + + +
wsithe connection to check
codean HTTP code like 200, 404 etc (see enum http_status)
ppointer to current position in buffer pointer
endpointer to end of buffer
+
+
+

Adds the initial response code, so should be called first

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_finalize_http_header (struct lws * wsi,
unsigned char ** p,
unsigned char * end 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_finalize_http_header() - terminate header block

+
Parameters
+ + + + +
wsithe connection to check
ppointer to current position in buffer pointer
endpointer to end of buffer
+
+
+

Indicates no more headers will be added

+ +
+
+
+
+ + + + diff --git a/doc/html/group__HTTP-headers-create.js b/doc/html/group__HTTP-headers-create.js new file mode 100644 index 00000000..a1ae2454 --- /dev/null +++ b/doc/html/group__HTTP-headers-create.js @@ -0,0 +1,8 @@ +var group__HTTP_headers_create = +[ + [ "lws_add_http_header_by_name", "group__HTTP-headers-create.html#ga2b36bf44405755ff51c1939303b995a8", null ], + [ "lws_add_http_header_by_token", "group__HTTP-headers-create.html#gaf74adb761b22566ad70004882712dce1", null ], + [ "lws_add_http_header_content_length", "group__HTTP-headers-create.html#gacc76a5babcb4dce1b01b1955aa7a2faf", null ], + [ "lws_add_http_header_status", "group__HTTP-headers-create.html#ga29b7d6d2ddfdbaff3d8b607e7e3151b6", null ], + [ "lws_finalize_http_header", "group__HTTP-headers-create.html#ga4887605ff2242a54db3a7fa01f6f864b", null ] +]; \ No newline at end of file diff --git a/doc/html/group__HTTP-headers-read.html b/doc/html/group__HTTP-headers-read.html new file mode 100644 index 00000000..7aa033f7 --- /dev/null +++ b/doc/html/group__HTTP-headers-read.html @@ -0,0 +1,499 @@ + + + + + + +libwebsockets: HTTP headers: read + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
HTTP headers: read
+
+
+ + + + + + +

+Data Structures

struct  lws_tokens
 
struct  lws_token_limits
 
+ + + +

+Enumerations

enum  lws_token_indexes {
+  WSI_TOKEN_GET_URI = 0, +WSI_TOKEN_POST_URI = 1, +WSI_TOKEN_OPTIONS_URI = 2, +WSI_TOKEN_HOST = 3, +
+  WSI_TOKEN_CONNECTION = 4, +WSI_TOKEN_UPGRADE = 5, +WSI_TOKEN_ORIGIN = 6, +WSI_TOKEN_DRAFT = 7, +
+  WSI_TOKEN_CHALLENGE = 8, +WSI_TOKEN_EXTENSIONS = 9, +WSI_TOKEN_KEY1 = 10, +WSI_TOKEN_KEY2 = 11, +
+  WSI_TOKEN_PROTOCOL = 12, +WSI_TOKEN_ACCEPT = 13, +WSI_TOKEN_NONCE = 14, +WSI_TOKEN_HTTP = 15, +
+  WSI_TOKEN_HTTP2_SETTINGS = 16, +WSI_TOKEN_HTTP_ACCEPT = 17, +WSI_TOKEN_HTTP_AC_REQUEST_HEADERS = 18, +WSI_TOKEN_HTTP_IF_MODIFIED_SINCE = 19, +
+  WSI_TOKEN_HTTP_IF_NONE_MATCH = 20, +WSI_TOKEN_HTTP_ACCEPT_ENCODING = 21, +WSI_TOKEN_HTTP_ACCEPT_LANGUAGE = 22, +WSI_TOKEN_HTTP_PRAGMA = 23, +
+  WSI_TOKEN_HTTP_CACHE_CONTROL = 24, +WSI_TOKEN_HTTP_AUTHORIZATION = 25, +WSI_TOKEN_HTTP_COOKIE = 26, +WSI_TOKEN_HTTP_CONTENT_LENGTH = 27, +
+  WSI_TOKEN_HTTP_CONTENT_TYPE = 28, +WSI_TOKEN_HTTP_DATE = 29, +WSI_TOKEN_HTTP_RANGE = 30, +WSI_TOKEN_HTTP_REFERER = 31, +
+  WSI_TOKEN_KEY = 32, +WSI_TOKEN_VERSION = 33, +WSI_TOKEN_SWORIGIN = 34, +WSI_TOKEN_HTTP_COLON_AUTHORITY = 35, +
+  WSI_TOKEN_HTTP_COLON_METHOD = 36, +WSI_TOKEN_HTTP_COLON_PATH = 37, +WSI_TOKEN_HTTP_COLON_SCHEME = 38, +WSI_TOKEN_HTTP_COLON_STATUS = 39, +
+  WSI_TOKEN_HTTP_ACCEPT_CHARSET = 40, +WSI_TOKEN_HTTP_ACCEPT_RANGES = 41, +WSI_TOKEN_HTTP_ACCESS_CONTROL_ALLOW_ORIGIN = 42, +WSI_TOKEN_HTTP_AGE = 43, +
+  WSI_TOKEN_HTTP_ALLOW = 44, +WSI_TOKEN_HTTP_CONTENT_DISPOSITION = 45, +WSI_TOKEN_HTTP_CONTENT_ENCODING = 46, +WSI_TOKEN_HTTP_CONTENT_LANGUAGE = 47, +
+  WSI_TOKEN_HTTP_CONTENT_LOCATION = 48, +WSI_TOKEN_HTTP_CONTENT_RANGE = 49, +WSI_TOKEN_HTTP_ETAG = 50, +WSI_TOKEN_HTTP_EXPECT = 51, +
+  WSI_TOKEN_HTTP_EXPIRES = 52, +WSI_TOKEN_HTTP_FROM = 53, +WSI_TOKEN_HTTP_IF_MATCH = 54, +WSI_TOKEN_HTTP_IF_RANGE = 55, +
+  WSI_TOKEN_HTTP_IF_UNMODIFIED_SINCE = 56, +WSI_TOKEN_HTTP_LAST_MODIFIED = 57, +WSI_TOKEN_HTTP_LINK = 58, +WSI_TOKEN_HTTP_LOCATION = 59, +
+  WSI_TOKEN_HTTP_MAX_FORWARDS = 60, +WSI_TOKEN_HTTP_PROXY_AUTHENTICATE = 61, +WSI_TOKEN_HTTP_PROXY_AUTHORIZATION = 62, +WSI_TOKEN_HTTP_REFRESH = 63, +
+  WSI_TOKEN_HTTP_RETRY_AFTER = 64, +WSI_TOKEN_HTTP_SERVER = 65, +WSI_TOKEN_HTTP_SET_COOKIE = 66, +WSI_TOKEN_HTTP_STRICT_TRANSPORT_SECURITY = 67, +
+  WSI_TOKEN_HTTP_TRANSFER_ENCODING = 68, +WSI_TOKEN_HTTP_USER_AGENT = 69, +WSI_TOKEN_HTTP_VARY = 70, +WSI_TOKEN_HTTP_VIA = 71, +
+  WSI_TOKEN_HTTP_WWW_AUTHENTICATE = 72, +WSI_TOKEN_PATCH_URI = 73, +WSI_TOKEN_PUT_URI = 74, +WSI_TOKEN_DELETE_URI = 75, +
+  WSI_TOKEN_HTTP_URI_ARGS = 76, +WSI_TOKEN_PROXY = 77, +WSI_TOKEN_HTTP_X_REAL_IP = 78, +WSI_TOKEN_HTTP1_0 = 79, +
+  _WSI_TOKEN_CLIENT_SENT_PROTOCOLS, +_WSI_TOKEN_CLIENT_PEER_ADDRESS, +_WSI_TOKEN_CLIENT_URI, +_WSI_TOKEN_CLIENT_HOST, +
+  _WSI_TOKEN_CLIENT_ORIGIN, +_WSI_TOKEN_CLIENT_METHOD, +WSI_TOKEN_COUNT, +WSI_TOKEN_NAME_PART, +
+  WSI_TOKEN_SKIPPING, +WSI_TOKEN_SKIPPING_SAW_CR, +WSI_PARSING_COMPLETE, +WSI_INIT_TOKEN_MUXURL +
+ }
 
+ + + + + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN const unsigned char * lws_token_to_string (enum lws_token_indexes token)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_hdr_total_length (struct lws *wsi, enum lws_token_indexes h)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_hdr_fragment_length (struct lws *wsi, enum lws_token_indexes h, int frag_idx)
 
LWS_VISIBLE LWS_EXTERN int lws_hdr_copy (struct lws *wsi, char *dest, int len, enum lws_token_indexes h)
 
LWS_VISIBLE LWS_EXTERN int lws_hdr_copy_fragment (struct lws *wsi, char *dest, int len, enum lws_token_indexes h, int frag_idx)
 
LWS_VISIBLE LWS_EXTERN const char * lws_get_urlarg_by_name (struct lws *wsi, const char *name, char *buf, int len)
 
+

Detailed Description

+

HTTP header releated functions

+

In lws the client http headers are temporarily stored in a pool, only for the duration of the http part of the handshake. It's because in most cases, the header content is ignored for the whole rest of the connection lifetime and would then just be taking up space needlessly.

+

During LWS_CALLBACK_HTTP when the URI path is delivered is the last time the http headers are still allocated, you can use these apis then to look at and copy out interesting header content (cookies, etc)

+

Notice that the header total length reported does not include a terminating '\0', however you must allocate for it when using the _copy apis. So the length reported for a header containing "123" is 3, but you must provide a buffer of length 4 so that "123\0" may be copied into it, or the copy will fail with a nonzero return code.

+

In the special case of URL arguments, like ?x=1&y=2, the arguments are stored in a token named for the method, eg, WSI_TOKEN_GET_URI if it was a GET or WSI_TOKEN_POST_URI if POST. You can check the total length to confirm the method.

+

For URL arguments, each argument is stored urldecoded in a "fragment", so you can use the fragment-aware api lws_hdr_copy_fragment() to access each argument in turn: the fragments contain urldecoded strings like x=1 or y=2.

+

As a convenience, lws has an api that will find the fragment with a given name= part, lws_get_urlarg_by_name().

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN const char* lws_get_urlarg_by_name (struct lws * wsi,
const char * name,
char * buf,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_urlarg_by_name() - return pointer to arg value if present

Parameters
+ + + + + +
wsithe connection to check
namethe arg name, like "token="
bufthe buffer to receive the urlarg (including the name= part)
lenthe length of the buffer to receive the urlarg
Returns NULL if not found or a pointer inside buf to just after the
+name= part.
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_hdr_copy (struct lws * wsi,
char * dest,
int len,
enum lws_token_indexes h 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_hdr_copy() - copy a single fragment of the given header to a buffer The buffer length len must include space for an additional terminating '\0', or it will fail returning -1.

+
Parameters
+ + + + + +
wsiwebsocket connection
destdestination buffer
lenlength of destination buffer
hwhich header index we are interested in
+
+
+

copies the whole, aggregated header, even if it was delivered in several actual headers piece by piece

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_hdr_copy_fragment (struct lws * wsi,
char * dest,
int len,
enum lws_token_indexes h,
int frag_idx 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_hdr_copy_fragment() - copy a single fragment of the given header to a buffer The buffer length len must include space for an additional terminating '\0', or it will fail returning -1. If the requested fragment index is not present, it fails returning -1.

+
Parameters
+ + + + + + +
wsiwebsocket connection
destdestination buffer
lenlength of destination buffer
hwhich header index we are interested in
frag_idxwhich fragment of h we want to copy
+
+
+

Normally this is only useful to parse URI arguments like ?x=1&y=2, token index WSI_TOKEN_HTTP_URI_ARGS fragment 0 will contain "x=1" and fragment 1 "y=2"

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_hdr_fragment_length (struct lws * wsi,
enum lws_token_indexes h,
int frag_idx 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_hdr_fragment_length: report length of a single fragment of a header The returned length does not include the space for a terminating '\0'

+
Parameters
+ + + + +
wsiwebsocket connection
hwhich header index we are interested in
frag_idxwhich fragment of h we want to get the length of
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_hdr_total_length (struct lws * wsi,
enum lws_token_indexes h 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_hdr_total_length: report length of all fragments of a header totalled up The returned length does not include the space for a terminating '\0'

+
Parameters
+ + + +
wsiwebsocket connection
hwhich header index we are interested in
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN const unsigned char* lws_token_to_string (enum lws_token_indexes token)
+
+ +

#include <lib/libwebsockets.h>

+

lws_token_to_string() - returns a textual representation of a hdr token index

+
Parameters
+ + +
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__HTTP-headers-read.js b/doc/html/group__HTTP-headers-read.js new file mode 100644 index 00000000..36013b0a --- /dev/null +++ b/doc/html/group__HTTP-headers-read.js @@ -0,0 +1,16 @@ +var group__HTTP_headers_read = +[ + [ "lws_tokens", "structlws__tokens.html", [ + [ "token", "structlws__tokens.html#a9f3635412bc71a5cb78e9862b55f10cd", null ], + [ "token_len", "structlws__tokens.html#a855b7375d1d58516c0ecd4b60e9a7766", null ] + ] ], + [ "lws_token_limits", "structlws__token__limits.html", [ + [ "token_limit", "structlws__token__limits.html#a6ec712306cbf8585bce7a56758a3ceff", null ] + ] ], + [ "lws_get_urlarg_by_name", "group__HTTP-headers-read.html#ga84e9ce5e71a77501a0998ac403a984c2", null ], + [ "lws_hdr_copy", "group__HTTP-headers-read.html#ga6ce6aa1c0155ea42b7708bed271d1c77", null ], + [ "lws_hdr_copy_fragment", "group__HTTP-headers-read.html#gaa427cad61a9a5e3004afd65c4527b5e9", null ], + [ "lws_hdr_fragment_length", "group__HTTP-headers-read.html#ga594f3d0ece5b09c2ccf9f98ea533bb4e", null ], + [ "lws_hdr_total_length", "group__HTTP-headers-read.html#ga8ade0e1ffb0da7e62b989d8d867bf6c8", null ], + [ "lws_token_to_string", "group__HTTP-headers-read.html#ga2c0597b2ef1d2cee35736c338bcbd17b", null ] +]; \ No newline at end of file diff --git a/doc/html/group__Protocols-and-Plugins.html b/doc/html/group__Protocols-and-Plugins.html new file mode 100644 index 00000000..f6399bdb --- /dev/null +++ b/doc/html/group__Protocols-and-Plugins.html @@ -0,0 +1,316 @@ + + + + + + +libwebsockets: Protocols and Plugins + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Protocols and Plugins
+
+
+ + + + +

+Modules

 plugin: generic-sessions
 
+ + + + + + + +

+Data Structures

struct  lws_protocols
 
struct  lws_plugin_capability
 
struct  lws_plugin
 
+ + + + + +

+Typedefs

+typedef int(* lws_plugin_init_func) (struct lws_context *, struct lws_plugin_capability *)
 
+typedef int(* lws_plugin_destroy_func) (struct lws_context *)
 
+ + + + + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN const struct lws_protocolslws_vhost_name_to_protocol (struct lws_vhost *vh, const char *name)
 
LWS_VISIBLE LWS_EXTERN const struct lws_protocolslws_get_protocol (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN const struct lws_protocolslws_protocol_get (struct lws *wsi) LWS_WARN_DEPRECATED
 
LWS_VISIBLE LWS_EXTERN void * lws_protocol_vh_priv_zalloc (struct lws_vhost *vhost, const struct lws_protocols *prot, int size)
 
LWS_VISIBLE LWS_EXTERN void * lws_protocol_vh_priv_get (struct lws_vhost *vhost, const struct lws_protocols *prot)
 
LWS_VISIBLE LWS_EXTERN int lws_finalize_startup (struct lws_context *context)
 
+

Detailed Description

+

Protocol and protocol plugin -related apis

+

Protocols bind ws protocol names to a custom callback specific to that protocol implementaion.

+

A list of protocols can be passed in at context creation time, but it is also legal to leave that NULL and add the protocols and their callback code using plugins.

+

Plugins are much preferable compared to cut and pasting code into an application each time, since they can be used standalone.

+

Function Documentation

+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_finalize_startup (struct lws_context * context)
+
+ +

#include <lib/libwebsockets.h>

+

lws_finalize_startup() - drop initial process privileges

+
Parameters
+ + +
contextlws context
+
+
+

This is called after the end of the vhost protocol initializations, but you may choose to call it earlier

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN const struct lws_protocols* lws_get_protocol (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_protocol() - Returns a protocol pointer from a websocket connection.

Parameters
+ + +
wsipointer to struct websocket you want to know the protocol of
+
+
+
 Some apis can act on all live connections of a given protocol,
+ this is how you can get a pointer to the active protocol if needed.
+
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN const struct lws_protocols* lws_protocol_get (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_protocol_get() - deprecated: use lws_get_protocol

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN void* lws_protocol_vh_priv_get (struct lws_vhost * vhost,
const struct lws_protocolsprot 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_protocol_vh_priv_get() - retreive a protocol's per-vhost storage

+
Parameters
+ + + +
vhostvhost the instance is related to
protprotocol the instance is related to
+
+
+

Recover a pointer to the allocated per-vhost storage for the protocol created by lws_protocol_vh_priv_zalloc() earlier

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN void* lws_protocol_vh_priv_zalloc (struct lws_vhost * vhost,
const struct lws_protocolsprot,
int size 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_protocol_vh_priv_zalloc() - Allocate and zero down a protocol's per-vhost storage

Parameters
+ + + + +
vhostvhost the instance is related to
protprotocol the instance is related to
sizebytes to allocate
+
+
+

Protocols often find it useful to allocate a per-vhost struct, this is a helper to be called in the per-vhost init LWS_CALLBACK_PROTOCOL_INIT

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN const struct lws_protocols* lws_vhost_name_to_protocol (struct lws_vhost * vh,
const char * name 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_vhost_name_to_protocol() - get vhost's protocol object from its name

+
Parameters
+ + + +
vhvhost to search
nameprotocol name
+
+
+

Returns NULL or a pointer to the vhost's protocol of the requested name

+ +
+
+
+
+ + + + diff --git a/doc/html/group__Protocols-and-Plugins.js b/doc/html/group__Protocols-and-Plugins.js new file mode 100644 index 00000000..f6818da3 --- /dev/null +++ b/doc/html/group__Protocols-and-Plugins.js @@ -0,0 +1,32 @@ +var group__Protocols_and_Plugins = +[ + [ "plugin: generic-sessions", "group__generic-sessions.html", "group__generic-sessions" ], + [ "lws_protocols", "structlws__protocols.html", [ + [ "callback", "structlws__protocols.html#acabf94c1a9bfe7be0387fbb0e0c56b2d", null ], + [ "id", "structlws__protocols.html#a6b632018590c2b1bbe43fbab6d5e6fac", null ], + [ "name", "structlws__protocols.html#a0e63edb457a613c3fa4271e0a8f19624", null ], + [ "per_session_data_size", "structlws__protocols.html#a9bbd85f591ffb4259711cb5acbb05bea", null ], + [ "rx_buffer_size", "structlws__protocols.html#a0d1d4996d81b2f5e125bcec981e461c5", null ], + [ "user", "structlws__protocols.html#a3cbd903ad076736ae934a54cae36580e", null ] + ] ], + [ "lws_plugin_capability", "structlws__plugin__capability.html", [ + [ "api_magic", "structlws__plugin__capability.html#a523c7cde6f15bba345f56493dcf6b32a", null ], + [ "count_extensions", "structlws__plugin__capability.html#abcf51db969522fdda9aaf902e65739d3", null ], + [ "count_protocols", "structlws__plugin__capability.html#ae38f7cf1246b9ca3af3cbf9d46b7090f", null ], + [ "extensions", "structlws__plugin__capability.html#a7936f0eb93d79dea76b903d0f8a5f623", null ], + [ "protocols", "structlws__plugin__capability.html#a6a4d9d01e770f378ddadc77b37522033", null ] + ] ], + [ "lws_plugin", "structlws__plugin.html", [ + [ "caps", "structlws__plugin.html#ac7f1fdfe8cf8a21f8ee9720c21934a3f", null ], + [ "l", "structlws__plugin.html#a4ef37a43653715b6c69cbf8a7be747f4", null ], + [ "lib", "structlws__plugin.html#af9e1042dc1de5b9d202c2f5fd1834330", null ], + [ "list", "structlws__plugin.html#a65dffd68fd267ce17b988790d1d35f22", null ], + [ "name", "structlws__plugin.html#af4ac8fcb79e10e0c2d960e1804d98105", null ] + ] ], + [ "lws_finalize_startup", "group__Protocols-and-Plugins.html#ga106b37ae9c247e84d191ab09441adc43", null ], + [ "lws_get_protocol", "group__Protocols-and-Plugins.html#ga72ad550786ca7976463589d347e62112", null ], + [ "lws_protocol_get", "group__Protocols-and-Plugins.html#ga8bbe5e65faca068845704bab911a5030", null ], + [ "lws_protocol_vh_priv_get", "group__Protocols-and-Plugins.html#gaf3be4243443baac0f8be1fcfb4d25129", null ], + [ "lws_protocol_vh_priv_zalloc", "group__Protocols-and-Plugins.html#gaec0c0477288ff3f83aff38d357b883d1", null ], + [ "lws_vhost_name_to_protocol", "group__Protocols-and-Plugins.html#ga25754726d97c5f519d313e691a9fe29d", null ] +]; \ No newline at end of file diff --git a/doc/html/group__callback-when-writeable.html b/doc/html/group__callback-when-writeable.html new file mode 100644 index 00000000..1b7e3755 --- /dev/null +++ b/doc/html/group__callback-when-writeable.html @@ -0,0 +1,426 @@ + + + + + + +libwebsockets: Callback when writeable + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Callback when writeable
+
+
+ + + + + + + + + + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN int lws_callback_on_writable (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN int lws_callback_on_writable_all_protocol (const struct lws_context *context, const struct lws_protocols *protocol)
 
LWS_VISIBLE LWS_EXTERN int lws_callback_on_writable_all_protocol_vhost (const struct lws_vhost *vhost, const struct lws_protocols *protocol)
 
LWS_VISIBLE LWS_EXTERN int lws_callback_all_protocol (struct lws_context *context, const struct lws_protocols *protocol, int reason)
 
LWS_VISIBLE LWS_EXTERN int lws_callback_all_protocol_vhost (struct lws_vhost *vh, const struct lws_protocols *protocol, int reason)
 
LWS_VISIBLE LWS_EXTERN int lws_callback_vhost_protocols (struct lws *wsi, int reason, void *in, int len)
 
LWS_VISIBLE LWS_EXTERN int lws_get_socket_fd (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN size_t lws_get_peer_write_allowance (struct lws *wsi)
 
+

Detailed Description

+

Callback When Writeable

+

lws can only write data on a connection when it is able to accept more data without blocking.

+

So a basic requirement is we should only use the lws_write() apis when the connection we want to write on says that he can accept more data.

+

When lws cannot complete your send at the time, it will buffer the data and send it in the background, suppressing any further WRITEABLE callbacks on that connection until it completes. So it is important to write new things in a new writeable callback.

+

These apis reflect the various ways we can indicate we would like to be called back when one or more connections is writeable.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_callback_all_protocol (struct lws_context * context,
const struct lws_protocolsprotocol,
int reason 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_callback_all_protocol() - Callback all connections using the given protocol with the given reason

+
Parameters
+ + + + +
contextlws_context
protocolProtocol whose connections will get callbacks
reasonCallback reason index
+
+
+
    +
  • Which: connections using this protocol on ALL VHOSTS
  • +
  • When: when the individual connection becomes writeable
  • +
  • What: reason
  • +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_callback_all_protocol_vhost (struct lws_vhost * vh,
const struct lws_protocolsprotocol,
int reason 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_callback_all_protocol_vhost() - Callback all connections using the given protocol with the given reason

+
Parameters
+ + + + +
vhVhost whose connections will get callbacks
protocolWhich protocol to match
reasonCallback reason index
+
+
+
    +
  • Which: connections using this protocol on GIVEN VHOST ONLY
  • +
  • When: now
  • +
  • What: reason
  • +
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_callback_on_writable (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_callback_on_writable() - Request a callback when this socket becomes able to be written to without blocking

+
Parameters
+ + +
wsiWebsocket connection instance to get callback for
+
+
+
    +
  • Which: only this wsi
  • +
  • When: when the individual connection becomes writeable
  • +
  • What: LWS_CALLBACK_*_WRITEABLE
  • +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_callback_on_writable_all_protocol (const struct lws_context * context,
const struct lws_protocolsprotocol 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_callback_on_writable_all_protocol() - Request a callback for all connections on same vhost using the given protocol when it becomes possible to write to each socket without blocking in turn.

+
Parameters
+ + + +
contextlws_context
protocolProtocol whose connections will get callbacks
+
+
+
    +
  • Which: connections using this protocol on ANY VHOST
  • +
  • When: when the individual connection becomes writeable
  • +
  • What: LWS_CALLBACK_*_WRITEABLE
  • +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_callback_on_writable_all_protocol_vhost (const struct lws_vhost * vhost,
const struct lws_protocolsprotocol 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_callback_on_writable_all_protocol_vhost() - Request a callback for all connections using the given protocol when it becomes possible to write to each socket without blocking in turn.

+
Parameters
+ + + +
vhostOnly consider connections on this lws_vhost
protocolProtocol whose connections will get callbacks
+
+
+
    +
  • Which: connections using this protocol on GIVEN VHOST ONLY
  • +
  • When: when the individual connection becomes writeable
  • +
  • What: LWS_CALLBACK_*_WRITEABLE
  • +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_callback_vhost_protocols (struct lws * wsi,
int reason,
void * in,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_callback_vhost_protocols() - Callback all protocols enabled on a vhost with the given reason

+
Parameters
+ + + + + +
wsiwsi whose vhost will get callbacks
reasonCallback reason index
inin argument to callback
lenlen argument to callback
+
+
+
    +
  • Which: connections using this protocol on same VHOST as wsi ONLY
  • +
  • When: now
  • +
  • What: reason
  • +
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN size_t lws_get_peer_write_allowance (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_peer_write_allowance() - get the amount of data writeable to peer if known

+
Parameters
+ + +
wsiWebsocket connection instance
+
+
+

if the protocol does not have any guidance, returns -1. Currently only http2 connections get send window information from this API. But your code should use it so it can work properly with any protocol.

+

If nonzero return is the amount of payload data the peer or intermediary has reported it has buffer space for. That has NO relationship with the amount of buffer space your OS can accept on this connection for a write action.

+

This number represents the maximum you could send to the peer or intermediary on this connection right now without the protocol complaining.

+

lws manages accounting for send window updates and payload writes automatically, so this number reflects the situation at the peer or intermediary dynamically.

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_get_socket_fd (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_socket_fd() - returns the socket file descriptor

+

You will not need this unless you are doing something special

+
Parameters
+ + +
wsiWebsocket connection instance
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__callback-when-writeable.js b/doc/html/group__callback-when-writeable.js new file mode 100644 index 00000000..3651eed1 --- /dev/null +++ b/doc/html/group__callback-when-writeable.js @@ -0,0 +1,11 @@ +var group__callback_when_writeable = +[ + [ "lws_callback_all_protocol", "group__callback-when-writeable.html#gacf04bbe089f47c971c6408c5efe2ac70", null ], + [ "lws_callback_all_protocol_vhost", "group__callback-when-writeable.html#ga13c984d8c5a44a745fd02bc2fba36053", null ], + [ "lws_callback_on_writable", "group__callback-when-writeable.html#ga941caaa468bc507b1cae52275f58800d", null ], + [ "lws_callback_on_writable_all_protocol", "group__callback-when-writeable.html#gabbe4655c7eeb3eb1671b2323ec6b3107", null ], + [ "lws_callback_on_writable_all_protocol_vhost", "group__callback-when-writeable.html#ga8570860e191b62db264f2bac67354ea8", null ], + [ "lws_callback_vhost_protocols", "group__callback-when-writeable.html#ga60939cf0c073d933fde3d17f3591caf5", null ], + [ "lws_get_peer_write_allowance", "group__callback-when-writeable.html#gac4643fe16b0940ae5b68b4ee6195cbde", null ], + [ "lws_get_socket_fd", "group__callback-when-writeable.html#gaa709e02a10558753c851e58f1e2c16ba", null ] +]; \ No newline at end of file diff --git a/doc/html/group__cgi.html b/doc/html/group__cgi.html new file mode 100644 index 00000000..e6db1e22 --- /dev/null +++ b/doc/html/group__cgi.html @@ -0,0 +1,82 @@ + + + + + + +libwebsockets: cgi handling + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+
+
cgi handling
+
+
+

CGI handling

+

These functions allow low-level control over stdin/out/err of the cgi.

+

However for most cases, binding the cgi to http in and out, the default lws implementation already does the right thing.

+
+
+ + + + diff --git a/doc/html/group__client.html b/doc/html/group__client.html new file mode 100644 index 00000000..15d75f11 --- /dev/null +++ b/doc/html/group__client.html @@ -0,0 +1,353 @@ + + + + + + +libwebsockets: Client + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Client
+
+
+ + + + +

+Data Structures

struct  lws_client_connect_info
 
+ + + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN struct lws *LWS_WARN_UNUSED_RESULT lws_client_connect_via_info (struct lws_client_connect_info *ccinfo)
 
LWS_VISIBLE LWS_EXTERN struct lws *LWS_WARN_UNUSED_RESULT lws_client_connect (struct lws_context *clients, const char *address, int port, int ssl_connection, const char *path, const char *host, const char *origin, const char *protocol, int ietf_version_or_minus_one) LWS_WARN_DEPRECATED
 
LWS_VISIBLE LWS_EXTERN struct lws *LWS_WARN_UNUSED_RESULT lws_client_connect_extended (struct lws_context *clients, const char *address, int port, int ssl_connection, const char *path, const char *host, const char *origin, const char *protocol, int ietf_version_or_minus_one, void *userdata) LWS_WARN_DEPRECATED
 
LWS_VISIBLE LWS_EXTERN int lws_init_vhost_client_ssl (const struct lws_context_creation_info *info, struct lws_vhost *vhost)
 
+LWS_VISIBLE LWS_EXTERN int lws_http_client_read (struct lws *wsi, char **buf, int *len)
 
+

Detailed Description

+

Client releated functions

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws* LWS_WARN_UNUSED_RESULT lws_client_connect (struct lws_context * clients,
const char * address,
int port,
int ssl_connection,
const char * path,
const char * host,
const char * origin,
const char * protocol,
int ietf_version_or_minus_one 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_client_connect() - Connect to another websocket server

Deprecated:
DEPRECATED use lws_client_connect_via_info
+
Parameters
+ + + + + + + + + + +
clientsWebsocket context
addressRemote server address, eg, "myserver.com"
portPort to connect to on the remote server, eg, 80
ssl_connection0 = ws://, 1 = wss:// encrypted, 2 = wss:// allow self signed certs
pathWebsocket path on server
hostHostname on server
originSocket origin name
protocolComma-separated list of protocols being asked for from the server, or just one. The server will pick the one it likes best. If you don't want to specify a protocol, which is legal, use NULL here.
ietf_version_or_minus_one-1 to ask to connect using the default, latest protocol supported, or the specific protocol ordinal
+
+
+

This function creates a connection to a remote server

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws* LWS_WARN_UNUSED_RESULT lws_client_connect_extended (struct lws_context * clients,
const char * address,
int port,
int ssl_connection,
const char * path,
const char * host,
const char * origin,
const char * protocol,
int ietf_version_or_minus_one,
void * userdata 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_client_connect_extended() - Connect to another websocket server

Deprecated:
DEPRECATED use lws_client_connect_via_info
+
Parameters
+ + + + + + + + + + + +
clientsWebsocket context
addressRemote server address, eg, "myserver.com"
portPort to connect to on the remote server, eg, 80
ssl_connection0 = ws://, 1 = wss:// encrypted, 2 = wss:// allow self signed certs
pathWebsocket path on server
hostHostname on server
originSocket origin name
protocolComma-separated list of protocols being asked for from the server, or just one. The server will pick the one it likes best.
ietf_version_or_minus_one-1 to ask to connect using the default, latest protocol supported, or the specific protocol ordinal
userdataPre-allocated user data
 This function creates a connection to a remote server
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws* LWS_WARN_UNUSED_RESULT lws_client_connect_via_info (struct lws_client_connect_infoccinfo)
+
+ +

#include <lib/libwebsockets.h>

+

lws_client_connect_via_info() - Connect to another websocket server

Parameters
+ + +
ccinfopointer to lws_client_connect_info struct
 This function creates a connection to a remote server
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_init_vhost_client_ssl (const struct lws_context_creation_infoinfo,
struct lws_vhost * vhost 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_init_vhost_client_ssl() - also enable client SSL on an existing vhost

+
Parameters
+ + + +
infoclient ssl related info
vhostwhich vhost to initialize client ssl operations on
+
+
+

You only need to call this if you plan on using SSL client connections on the vhost. For non-SSL client connections, it's not necessary to call this.

+

The following members of info are used during the call

  - options must have LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT set,
+      otherwise the call does nothing
+  - provided_client_ssl_ctx must be NULL to get a generated client
+      ssl context, otherwise you can pass a prepared one in by setting it
+  - ssl_cipher_list may be NULL or set to the client valid cipher list
+  - ssl_ca_filepath may be NULL or client cert filepath
+  - ssl_cert_filepath may be NULL or client cert filepath
+  - ssl_private_key_filepath may be NULL or client cert private key
+

You must create your vhost explicitly if you want to use this, so you have a pointer to the vhost. Create the context first with the option flag LWS_SERVER_OPTION_EXPLICIT_VHOSTS and then call lws_create_vhost() with the same info struct.

+ +
+
+
+
+ + + + diff --git a/doc/html/group__client.js b/doc/html/group__client.js new file mode 100644 index 00000000..9d877f27 --- /dev/null +++ b/doc/html/group__client.js @@ -0,0 +1,26 @@ +var group__client = +[ + [ "lws_client_connect_info", "structlws__client__connect__info.html", [ + [ "_unused", "structlws__client__connect__info.html#ad47f50d1633dc5df74548606c9a66d73", null ], + [ "address", "structlws__client__connect__info.html#aa364094f94ef1bcaaabbd9161971d502", null ], + [ "client_exts", "structlws__client__connect__info.html#a7732b996e977393c3e1076be2a8ded6c", null ], + [ "context", "structlws__client__connect__info.html#afe999d133cc240a0bfd02aade0514cfd", null ], + [ "host", "structlws__client__connect__info.html#a9b36d47c3422329df32c21040a35ebc7", null ], + [ "ietf_version_or_minus_one", "structlws__client__connect__info.html#a69abb5aeed755750b9755e5c91db6895", null ], + [ "method", "structlws__client__connect__info.html#aa9e8e3da4e783a0651b0dea62c2dd1db", null ], + [ "origin", "structlws__client__connect__info.html#a8595f83e64147cb687b6418cf500dd4c", null ], + [ "parent_wsi", "structlws__client__connect__info.html#a6843a60e1050b10db9d98d7eeb45f587", null ], + [ "path", "structlws__client__connect__info.html#a76a8388733f114fb8fd3643874781185", null ], + [ "port", "structlws__client__connect__info.html#a1af124d81c3c22a46d39387c5bc3d6b9", null ], + [ "protocol", "structlws__client__connect__info.html#aba35adfb74845a5fd0c3dc141cbdddd2", null ], + [ "ssl_connection", "structlws__client__connect__info.html#a9862297827639238a7a0b4054c3ddf3d", null ], + [ "uri_replace_from", "structlws__client__connect__info.html#a03c305fdca809667b6a9a83b3edfd83a", null ], + [ "uri_replace_to", "structlws__client__connect__info.html#a9959ba103d3d2484e559a9f7879eebe3", null ], + [ "userdata", "structlws__client__connect__info.html#a9831b9f9ab54a1aec4bb15324f1c3836", null ], + [ "vhost", "structlws__client__connect__info.html#a3893181d728f326f9f5b47c1459cb8be", null ] + ] ], + [ "lws_client_connect", "group__client.html#ga4af0a20108a95e8b6d94dd4d80055ff3", null ], + [ "lws_client_connect_extended", "group__client.html#gac6a8558b4410961a880241c2ac1271e2", null ], + [ "lws_client_connect_via_info", "group__client.html#gac30a7be106abd0cedfbb2e8b8fe3a2f5", null ], + [ "lws_init_vhost_client_ssl", "group__client.html#ga4f44b8230e6732816ca5cd8d1aaaf340", null ] +]; \ No newline at end of file diff --git a/doc/html/group__context-and-vhost.html b/doc/html/group__context-and-vhost.html new file mode 100644 index 00000000..879d4dcd --- /dev/null +++ b/doc/html/group__context-and-vhost.html @@ -0,0 +1,657 @@ + + + + + + +libwebsockets: Context-and-vhost + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Context-and-vhost
+
+
+ + + + +

+Modules

 Vhost mounts and options
 
+ + + + + +

+Data Structures

struct  lws_context_creation_info
 
struct  lws_protocol_vhost_options
 
+ + + +

+Enumerations

enum  lws_context_options {
+  LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, +LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = (1 << 2), +LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT, +LWS_SERVER_OPTION_LIBEV = (1 << 4), +
+  LWS_SERVER_OPTION_DISABLE_IPV6 = (1 << 5), +LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS = (1 << 6), +LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED = (1 << 7), +LWS_SERVER_OPTION_VALIDATE_UTF8 = (1 << 8), +
+  LWS_SERVER_OPTION_SSL_ECDH, +LWS_SERVER_OPTION_LIBUV = (1 << 10), +LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS, +LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT = (1 << 12), +
+  LWS_SERVER_OPTION_EXPLICIT_VHOSTS = (1 << 13), +LWS_SERVER_OPTION_UNIX_SOCK = (1 << 14), +LWS_SERVER_OPTION_STS = (1 << 15), +LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY = (1 << 16), +
+  LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE = (1 << 17) +
+ }
 
+ + + + + + + + + + + + + + + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN struct lws_context * lws_create_context (struct lws_context_creation_info *info)
 
LWS_VISIBLE LWS_EXTERN void lws_context_destroy (struct lws_context *context)
 
LWS_VISIBLE LWS_EXTERN int lws_set_proxy (struct lws_vhost *vhost, const char *proxy)
 
LWS_EXTERN LWS_VISIBLE struct lws_vhost * lws_create_vhost (struct lws_context *context, struct lws_context_creation_info *info)
 
LWS_VISIBLE LWS_EXTERN int lwsws_get_config_globals (struct lws_context_creation_info *info, const char *d, char **config_strings, int *len)
 
LWS_VISIBLE LWS_EXTERN int lwsws_get_config_vhosts (struct lws_context *context, struct lws_context_creation_info *info, const char *d, char **config_strings, int *len)
 
LWS_VISIBLE LWS_EXTERN struct lws_vhost * lws_vhost_get (struct lws *wsi) LWS_WARN_DEPRECATED
 
LWS_VISIBLE LWS_EXTERN struct lws_vhost * lws_get_vhost (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN int lws_json_dump_vhost (const struct lws_vhost *vh, char *buf, int len)
 
LWS_VISIBLE LWS_EXTERN int lws_json_dump_context (const struct lws_context *context, char *buf, int len)
 
LWS_VISIBLE LWS_EXTERN void * lws_context_user (struct lws_context *context)
 
+

Detailed Description

+

Context and Vhost releated functions

+

LWS requires that there is one context, in which you may define multiple vhosts. Each vhost is a virtual host, with either its own listen port or sharing an existing one. Each vhost has its own SSL context that can be set up individually or left disabled.

+

If you don't care about multiple "site" support, you can ignore it and lws will create a single default vhost at context creation time.

+

Enumeration Type Documentation

+ +
+
+ + + + +
enum lws_context_options
+
+ +

#include <lib/libwebsockets.h>

+

enum lws_context_options - context and vhost options

+ + + + + + + + + + + + + + + + + + +
Enumerator
LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT  +

(VH) Don't allow the connection unless the client has a client cert that we recognize; provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT

+
LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME  +

(CTX) Don't try to get the server's hostname

+
LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT  +

(VH) Allow non-SSL (plaintext) connections on the same port as SSL is listening... undermines the security of SSL; provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT

+
LWS_SERVER_OPTION_LIBEV  +

(CTX) Use libev event loop

+
LWS_SERVER_OPTION_DISABLE_IPV6  +

(VH) Disable IPV6 support

+
LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS  +

(VH) Don't load OS CA certs, you will need to load your own CA cert(s)

+
LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED  +

(VH) Accept connections with no valid Cert (eg, selfsigned)

+
LWS_SERVER_OPTION_VALIDATE_UTF8  +

(VH) Check UT-8 correctness

+
LWS_SERVER_OPTION_SSL_ECDH  +

(VH) initialize ECDH ciphers

+
LWS_SERVER_OPTION_LIBUV  +

(CTX) Use libuv event loop

+
LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS  +

(VH) Use http redirect to force http to https (deprecated: use mount redirection)

+
LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT  +

(CTX) Initialize the SSL library at all

+
LWS_SERVER_OPTION_EXPLICIT_VHOSTS  +

(CTX) Only create the context when calling context create api, implies user code will create its own vhosts

+
LWS_SERVER_OPTION_UNIX_SOCK  +

(VH) Use Unix socket

+
LWS_SERVER_OPTION_STS  +

(VH) Send Strict Transport Security header, making clients subsequently go to https even if user asked for http

+
LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY  +

(VH) Enable LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE to take effect

+
LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE  +

(VH) if set, only ipv6 allowed on the vhost

+
+
1347  {
1349  (1 << 12),
1356  (1 << 12),
1360  LWS_SERVER_OPTION_LIBEV = (1 << 4),
1362  LWS_SERVER_OPTION_DISABLE_IPV6 = (1 << 5),
1371  LWS_SERVER_OPTION_SSL_ECDH = (1 << 9) |
1372  (1 << 12),
1374  LWS_SERVER_OPTION_LIBUV = (1 << 10),
1377  (1 << 3) |
1378  (1 << 12),
1386  LWS_SERVER_OPTION_UNIX_SOCK = (1 << 14),
1388  LWS_SERVER_OPTION_STS = (1 << 15),
1396  /****** add new things just above ---^ ******/
1397 };
+
Definition: libwebsockets.h:1364
+
Definition: libwebsockets.h:1376
+
Definition: libwebsockets.h:1383
+
Definition: libwebsockets.h:1353
+
Definition: libwebsockets.h:1371
+
Definition: libwebsockets.h:1355
+
Definition: libwebsockets.h:1360
+
Definition: libwebsockets.h:1381
+
Definition: libwebsockets.h:1393
+
Definition: libwebsockets.h:1362
+
Definition: libwebsockets.h:1374
+
Definition: libwebsockets.h:1386
+
Definition: libwebsockets.h:1369
+
Definition: libwebsockets.h:1367
+
Definition: libwebsockets.h:1388
+
Definition: libwebsockets.h:1391
+
+
+
+

Function Documentation

+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lws_context_destroy (struct lws_context * context)
+
+ +

#include <lib/libwebsockets.h>

+

lws_context_destroy() - Destroy the websocket context

Parameters
+ + +
contextWebsocket context
 This function closes any active connections and then frees the
+ context.  After calling this, any further use of the context is
+ undefined.
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN void* lws_context_user (struct lws_context * context)
+
+ +

#include <lib/libwebsockets.h>

+

lws_context_user() - get the user data associated with the context

Parameters
+ + +
contextWebsocket context
+
+
+

This returns the optional user allocation that can be attached to the context the sockets live in at context_create time. It's a way to let all sockets serviced in the same context share data without using globals statics in the user code.

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws_context* lws_create_context (struct lws_context_creation_infoinfo)
+
+ +

#include <lib/libwebsockets.h>

+

lws_create_context() - Create the websocket handler

Parameters
+ + +
infopointer to struct with parameters
 This function creates the listening socket (if serving) and takes care
+ of all initialization in one step.
+
+ If option LWS_SERVER_OPTION_EXPLICIT_VHOSTS is given, no vhost is
+ created; you're expected to create your own vhosts afterwards using
+ lws_create_vhost().  Otherwise a vhost named "default" is also created
+ using the information in the vhost-related members, for compatibility.
+
+ After initialization, it returns a struct lws_context * that
+ represents this server.  After calling, user code needs to take care
+ of calling lws_service() with the context pointer to get the
+ server's sockets serviced.  This must be done in the same process
+ context as the initialization call.
+
+ The protocol callback functions are called for a handful of events
+ including http requests coming in, websocket connections becoming
+ established, and data arriving; it's also called periodically to allow
+ async transmission.
+
+ HTTP requests are sent always to the FIRST protocol in protocol, since
+ at that time websocket protocol has not been negotiated.  Other
+ protocols after the first one never see any HTTP callack activity.
+
+ The server created is a simple http server by default; part of the
+ websocket standard is upgrading this http connection to a websocket one.
+
+ This allows the same server to provide files like scripts and favicon /
+ images or whatever over http and dynamic data over websockets all in
+ one place; they're all handled in the user callback.
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_EXTERN LWS_VISIBLE struct lws_vhost* lws_create_vhost (struct lws_context * context,
struct lws_context_creation_infoinfo 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_create_vhost() - Create a vhost (virtual server context)

Parameters
+ + + +
contextpointer to result of lws_create_context()
infopointer to struct with parameters
+
+
+

This function creates a virtual server (vhost) using the vhost-related members of the info struct. You can create many vhosts inside one context if you created the context with the option LWS_SERVER_OPTION_EXPLICIT_VHOSTS

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws_vhost* lws_get_vhost (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_vhost() - return the vhost a wsi belongs to

+
Parameters
+ + +
wsiwhich connection
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_json_dump_context (const struct lws_context * context,
char * buf,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_json_dump_context() - describe context state and stats in JSON

+
Parameters
+ + + + +
contextthe context
bufbuffer to fill with JSON
lenmax length of buf
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_json_dump_vhost (const struct lws_vhost * vh,
char * buf,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_json_dump_vhost() - describe vhost state and stats in JSON

+
Parameters
+ + + + +
vhthe vhost
bufbuffer to fill with JSON
lenmax length of buf
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_set_proxy (struct lws_vhost * vhost,
const char * proxy 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_set_proxy() - Setups proxy to lws_context.

Parameters
+ + + +
vhostpointer to struct lws_vhost you want set proxy for
proxypointer to c string containing proxy in format address:port
+
+
+

Returns 0 if proxy string was parsed and proxy was setup. Returns -1 if proxy is NULL or has incorrect format.

+

This is only required if your OS does not provide the http_proxy environment variable (eg, OSX)

+

IMPORTANT! You should call this function right after creation of the lws_context and before call to connect. If you call this function after connect behavior is undefined. This function will override proxy settings made on lws_context creation with genenv() call.

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws_vhost* lws_vhost_get (struct lws * wsi)
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lwsws_get_config_globals (struct lws_context_creation_infoinfo,
const char * d,
char ** config_strings,
int * len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lwsws_get_config_globals() - Parse a JSON server config file

Parameters
+ + + + + +
infopointer to struct with parameters
dfilepath of the config file
config_stringsstorage for the config strings extracted from JSON, the pointer is incremented as strings are stored
lenpointer to the remaining length left in config_strings the value is decremented as strings are stored
+
+
+

This function prepares a n lws_context_creation_info struct with global settings from a file d.

+

Requires CMake option LWS_WITH_LEJP_CONF to have been enabled

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lwsws_get_config_vhosts (struct lws_context * context,
struct lws_context_creation_infoinfo,
const char * d,
char ** config_strings,
int * len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lwsws_get_config_vhosts() - Create vhosts from a JSON server config file

Parameters
+ + + + + + +
contextpointer to result of lws_create_context()
infopointer to struct with parameters
dfilepath of the config file
config_stringsstorage for the config strings extracted from JSON, the pointer is incremented as strings are stored
lenpointer to the remaining length left in config_strings the value is decremented as strings are stored
+
+
+

This function creates vhosts into a context according to the settings in JSON files found in directory d.

+

Requires CMake option LWS_WITH_LEJP_CONF to have been enabled

+ +
+
+
+
+ + + + diff --git a/doc/html/group__context-and-vhost.js b/doc/html/group__context-and-vhost.js new file mode 100644 index 00000000..e6317dfa --- /dev/null +++ b/doc/html/group__context-and-vhost.js @@ -0,0 +1,81 @@ +var group__context_and_vhost = +[ + [ "Vhost mounts and options", "group__vhost-mounts.html", "group__vhost-mounts" ], + [ "lws_context_creation_info", "structlws__context__creation__info.html", [ + [ "_unused", "structlws__context__creation__info.html#afce3b59950eca3203faa07381bbed5d7", null ], + [ "count_threads", "structlws__context__creation__info.html#ae52f3237e144e9ddcab5e2cf91d1e419", null ], + [ "ecdh_curve", "structlws__context__creation__info.html#afa5d4e7d9f86b58a1c6fac14f0a5f5f9", null ], + [ "extensions", "structlws__context__creation__info.html#a4a3d1155fc52f5048b481884f6fb947c", null ], + [ "fd_limit_per_thread", "structlws__context__creation__info.html#a45e63e24c88289e0c8352377ef4d3646", null ], + [ "gid", "structlws__context__creation__info.html#a9c9d22437de92c197f3cee52912b2c03", null ], + [ "http_proxy_address", "structlws__context__creation__info.html#aef917c0b23976a264d2474901b4f5aa3", null ], + [ "http_proxy_port", "structlws__context__creation__info.html#a7b59f2bdc869871e7bde232db94f5ca6", null ], + [ "iface", "structlws__context__creation__info.html#a75434932bb5df54665ea678eb8ac104a", null ], + [ "ka_interval", "structlws__context__creation__info.html#a381342a398883d6204955ff3c1849ddd", null ], + [ "ka_probes", "structlws__context__creation__info.html#a3baab4285c679fbe027c2504621d7410", null ], + [ "ka_time", "structlws__context__creation__info.html#ac583ce92b8e1c949cb6fef6bfe713d56", null ], + [ "keepalive_timeout", "structlws__context__creation__info.html#a81697c6b763b5ef3ee52862bc70b07d6", null ], + [ "log_filepath", "structlws__context__creation__info.html#ad0e95ba721f7bd2b676719f8093c23a2", null ], + [ "max_http_header_data", "structlws__context__creation__info.html#a0cdfd3c484689ba6f0f2cc91b38ce948", null ], + [ "max_http_header_data2", "structlws__context__creation__info.html#aa8d9e85e137f35fb006f2e4a53f0887a", null ], + [ "max_http_header_pool", "structlws__context__creation__info.html#a0b154e79abc1167ba4ac3539f4af6720", null ], + [ "mounts", "structlws__context__creation__info.html#a13ffbb0d010309669611f8c4eda7d7f8", null ], + [ "options", "structlws__context__creation__info.html#a9d3b17a25e1fbc772f21eb4959a82724", null ], + [ "plugin_dirs", "structlws__context__creation__info.html#a8122cfc0810bafe51edb3ba6bf9a1251", null ], + [ "port", "structlws__context__creation__info.html#a424a5ce268d6903e42243be94487ab85", null ], + [ "protocols", "structlws__context__creation__info.html#abb90ffb3e6d6db2db20f529d61bd9122", null ], + [ "provided_client_ssl_ctx", "structlws__context__creation__info.html#a1654d41bea6fb2f619b57e6a264b26a4", null ], + [ "provided_client_ssl_ctx", "structlws__context__creation__info.html#a0e790dda6202604f73a03b6149bc12bb", null ], + [ "pt_serv_buf_size", "structlws__context__creation__info.html#a57f88c0745adbd1d6b9b619b8de30209", null ], + [ "pvo", "structlws__context__creation__info.html#a999866fcd15dbd621773436f97190458", null ], + [ "server_string", "structlws__context__creation__info.html#a137a9b9de4f6a7993fed8746d551e616", null ], + [ "ssl_ca_filepath", "structlws__context__creation__info.html#a4f8e65c3a059d3b586fafa9ef3282c29", null ], + [ "ssl_cert_filepath", "structlws__context__creation__info.html#ac62b0f0e8e402412ba5011d15c244103", null ], + [ "ssl_cipher_list", "structlws__context__creation__info.html#a3e1516fd7fed26bfa77c0246ed26c2eb", null ], + [ "ssl_options_clear", "structlws__context__creation__info.html#adb0bc0b28cd7d90ab306723d8ffa96fa", null ], + [ "ssl_options_set", "structlws__context__creation__info.html#a704940261951ced6b5d8191bd8b9bb2d", null ], + [ "ssl_private_key_filepath", "structlws__context__creation__info.html#ab9ec8893e0f7843cf5d783d2f350ef14", null ], + [ "ssl_private_key_password", "structlws__context__creation__info.html#af3fb447be15c4fcb01d3285a6678ab54", null ], + [ "timeout_secs", "structlws__context__creation__info.html#a6cfa3d51df2def3349a5cbf0d712822d", null ], + [ "token_limits", "structlws__context__creation__info.html#ac8a75b7b259a3c3a5fbb4219a3f06c29", null ], + [ "uid", "structlws__context__creation__info.html#ac105b4180008cb3e672d57beead8382e", null ], + [ "user", "structlws__context__creation__info.html#a0e9d94cdfb893d777b4a4db81e7b5ac0", null ], + [ "vhost_name", "structlws__context__creation__info.html#ad50db098a208f045f7811207d2bee4b9", null ] + ] ], + [ "lws_protocol_vhost_options", "structlws__protocol__vhost__options.html", [ + [ "name", "structlws__protocol__vhost__options.html#acf9db77f8eb64cd4e314be9b43d8a8b9", null ], + [ "next", "structlws__protocol__vhost__options.html#abc714ddb4171756fc8196e9823a1e21c", null ], + [ "options", "structlws__protocol__vhost__options.html#afd99fbc90be51ea2465b550c2ec47822", null ], + [ "value", "structlws__protocol__vhost__options.html#a0640a92513c70ee6b9b295a9ad1658e7", null ] + ] ], + [ "lws_context_options", "group__context-and-vhost.html#ga41c2d763f78cc248df3b9f8645dbd2a5", [ + [ "LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092", null ], + [ "LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c", null ], + [ "LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d", null ], + [ "LWS_SERVER_OPTION_LIBEV", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6", null ], + [ "LWS_SERVER_OPTION_DISABLE_IPV6", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9", null ], + [ "LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93", null ], + [ "LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc", null ], + [ "LWS_SERVER_OPTION_VALIDATE_UTF8", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f", null ], + [ "LWS_SERVER_OPTION_SSL_ECDH", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c", null ], + [ "LWS_SERVER_OPTION_LIBUV", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e", null ], + [ "LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada", null ], + [ "LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a", null ], + [ "LWS_SERVER_OPTION_EXPLICIT_VHOSTS", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e", null ], + [ "LWS_SERVER_OPTION_UNIX_SOCK", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941", null ], + [ "LWS_SERVER_OPTION_STS", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016", null ], + [ "LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8", null ], + [ "LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE", "group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160", null ] + ] ], + [ "lws_context_destroy", "group__context-and-vhost.html#ga8ee0314028755f1ddfa9428e09b4fddb", null ], + [ "lws_context_user", "group__context-and-vhost.html#gaeb12f934bfd178bd2132a9e73fc641da", null ], + [ "lws_create_context", "group__context-and-vhost.html#gaf2fff58562caab7510c41eeac85a8648", null ], + [ "lws_create_vhost", "group__context-and-vhost.html#ga0c54c667ccd9b8b3dddcd123ca72f87c", null ], + [ "lws_get_vhost", "group__context-and-vhost.html#ga06e77ce2916f8bc9826ef8d9d68e3932", null ], + [ "lws_json_dump_context", "group__context-and-vhost.html#gae2134657cdd2ea7a59e13ad314e4c50d", null ], + [ "lws_json_dump_vhost", "group__context-and-vhost.html#ga94e6cc2223c4eec316b13bcebc3628b6", null ], + [ "lws_set_proxy", "group__context-and-vhost.html#ga7e9d5405547a457d86e0b4f0ae2bb1c4", null ], + [ "lws_vhost_get", "group__context-and-vhost.html#ga8db03e19a372e34ac25cf21af894a02c", null ], + [ "lwsws_get_config_globals", "group__context-and-vhost.html#ga98d88c9080fd89c37114363a6474ea73", null ], + [ "lwsws_get_config_vhosts", "group__context-and-vhost.html#ga341064721add2618ae1b29717493a212", null ] +]; \ No newline at end of file diff --git a/doc/html/group__ev.html b/doc/html/group__ev.html new file mode 100644 index 00000000..252b589a --- /dev/null +++ b/doc/html/group__ev.html @@ -0,0 +1,104 @@ + + + + + + +libwebsockets: libev helpers + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
libev helpers
+
+
+ + + + +

+Typedefs

+typedef void( lws_ev_signal_cb_t) (EV_P_ struct ev_signal *w, int revents)
 
+ + + + + + + +

+Functions

+LWS_VISIBLE LWS_EXTERN int lws_ev_sigint_cfg (struct lws_context *context, int use_ev_sigint, lws_ev_signal_cb_t *cb)
 
+LWS_VISIBLE LWS_EXTERN int lws_ev_initloop (struct lws_context *context, struct ev_loop *loop, int tsi)
 
+LWS_VISIBLE LWS_EXTERN void lws_ev_sigint_cb (struct ev_loop *loop, struct ev_signal *watcher, int revents)
 
+

Detailed Description

+

libev helpers

+

APIs specific to libev event loop itegration

+
+
+ + + + diff --git a/doc/html/group__extensions.html b/doc/html/group__extensions.html new file mode 100644 index 00000000..eb15819f --- /dev/null +++ b/doc/html/group__extensions.html @@ -0,0 +1,449 @@ + + + + + + +libwebsockets: Extensions + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Extensions
+
+
+ + + + + + + + +

+Data Structures

struct  lws_ext_options
 
struct  lws_ext_option_arg
 
struct  lws_extension
 
+ + + +

+Typedefs

typedef int lws_extension_callback_function(struct lws_context *context, const struct lws_extension *ext, struct lws *wsi, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len)
 
+ + + + + +

+Enumerations

enum  lws_extension_callback_reasons {
+  LWS_EXT_CB_SERVER_CONTEXT_CONSTRUCT = 0, +LWS_EXT_CB_CLIENT_CONTEXT_CONSTRUCT = 1, +LWS_EXT_CB_SERVER_CONTEXT_DESTRUCT = 2, +LWS_EXT_CB_CLIENT_CONTEXT_DESTRUCT = 3, +
+  LWS_EXT_CB_CONSTRUCT = 4, +LWS_EXT_CB_CLIENT_CONSTRUCT = 5, +LWS_EXT_CB_CHECK_OK_TO_REALLY_CLOSE = 6, +LWS_EXT_CB_CHECK_OK_TO_PROPOSE_EXTENSION = 7, +
+  LWS_EXT_CB_DESTROY = 8, +LWS_EXT_CB_DESTROY_ANY_WSI_CLOSING = 9, +LWS_EXT_CB_ANY_WSI_ESTABLISHED = 10, +LWS_EXT_CB_PACKET_RX_PREPARSE = 11, +
+  LWS_EXT_CB_PACKET_TX_PRESEND = 12, +LWS_EXT_CB_PACKET_TX_DO_SEND = 13, +LWS_EXT_CB_HANDSHAKE_REPLY_TX = 14, +LWS_EXT_CB_FLUSH_PENDING_TX = 15, +
+  LWS_EXT_CB_EXTENDED_PAYLOAD_RX = 16, +LWS_EXT_CB_CAN_PROXY_CLIENT_CONNECTION = 17, +LWS_EXT_CB_1HZ = 18, +LWS_EXT_CB_REQUEST_ON_WRITEABLE = 19, +
+  LWS_EXT_CB_IS_WRITEABLE = 20, +LWS_EXT_CB_PAYLOAD_TX = 21, +LWS_EXT_CB_PAYLOAD_RX = 22, +LWS_EXT_CB_OPTION_DEFAULT = 23, +
+  LWS_EXT_CB_OPTION_SET = 24, +LWS_EXT_CB_OPTION_CONFIRM = 25, +LWS_EXT_CB_NAMED_OPTION_SET = 26 +
+ }
 
enum  lws_ext_options_types { EXTARG_NONE, +EXTARG_DEC, +EXTARG_OPT_DEC + }
 
+ + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN int lws_set_extension_option (struct lws *wsi, const char *ext_name, const char *opt_name, const char *opt_val)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_ext_parse_options (const struct lws_extension *ext, struct lws *wsi, void *ext_user, const struct lws_ext_options *opts, const char *o, int len)
 
LWS_EXTERN int lws_extension_callback_pm_deflate (struct lws_context *context, const struct lws_extension *ext, struct lws *wsi, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len)
 
+

Detailed Description

+

Extension releated functions

+

Ws defines optional extensions, lws provides the ability to implement these in user code if so desired.

+

We provide one extensions permessage-deflate.

+

Typedef Documentation

+ +
+
+ + + + +
typedef int lws_extension_callback_function(struct lws_context *context, const struct lws_extension *ext, struct lws *wsi, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len)
+
+ +

#include <lib/libwebsockets.h>

+

typedef lws_extension_callback_function() - Hooks to allow extensions to operate

Parameters
+ + + + + + + + +
contextWebsockets context
extThis extension
wsiOpaque websocket instance pointer
reasonThe reason for the call
userPointer to ptr to per-session user data allocated by library
inPointer used for some callback reasons
lenLength set for some callback reasons
 Each extension that is active on a particular connection receives
+ callbacks during the connection lifetime to allow the extension to
+ operate on websocket data and manage itself.
+
+ Libwebsockets takes care of allocating and freeing "user" memory for
+ each active extension on each connection.  That is what is pointed to
+ by the user parameter.
+
+ LWS_EXT_CB_CONSTRUCT:  called when the server has decided to
+    select this extension from the list provided by the client,
+    just before the server will send back the handshake accepting
+    the connection with this extension active.  This gives the
+    extension a chance to initialize its connection context found
+    in user.
+
+ LWS_EXT_CB_CLIENT_CONSTRUCT: same as LWS_EXT_CB_CONSTRUCT
+    but called when client is instantiating this extension.  Some
+    extensions will work the same on client and server side and then
+    you can just merge handlers for both CONSTRUCTS.
+
+ LWS_EXT_CB_DESTROY:  called when the connection the extension was
+    being used on is about to be closed and deallocated.  It's the
+    last chance for the extension to deallocate anything it has
+    allocated in the user data (pointed to by user) before the
+    user data is deleted.  This same callback is used whether you
+    are in client or server instantiation context.
+
+ LWS_EXT_CB_PACKET_RX_PREPARSE: when this extension was active on
+    a connection, and a packet of data arrived at the connection,
+    it is passed to this callback to give the extension a chance to
+    change the data, eg, decompress it.  user is pointing to the
+    extension's private connection context data, in is pointing
+    to an lws_tokens struct, it consists of a char * pointer called
+    token, and an int called token_len.  At entry, these are
+    set to point to the received buffer and set to the content
+    length.  If the extension will grow the content, it should use
+    a new buffer allocated in its private user context data and
+    set the pointed-to lws_tokens members to point to its buffer.
+
+ LWS_EXT_CB_PACKET_TX_PRESEND: this works the same way as
+    LWS_EXT_CB_PACKET_RX_PREPARSE above, except it gives the
+    extension a chance to change websocket data just before it will
+    be sent out.  Using the same lws_token pointer scheme in in,
+    the extension can change the buffer and the length to be
+    transmitted how it likes.  Again if it wants to grow the
+    buffer safely, it should copy the data into its own buffer and
+    set the lws_tokens token pointer to it.
+
+ LWS_EXT_CB_ARGS_VALIDATE:
+
+
+ +
+
+

Enumeration Type Documentation

+ +
+
+ + + + +
enum lws_ext_options_types
+
+ +

#include <lib/libwebsockets.h>

+

enum lws_ext_options_types

+ + + + +
Enumerator
EXTARG_NONE  +

does not take an argument

+
EXTARG_DEC  +

requires a decimal argument

+
EXTARG_OPT_DEC  +

may have an optional decimal argument

+
+
949  {
950  EXTARG_NONE,
951  EXTARG_DEC,
954  /* Add new things just above here ---^
955  * This is part of the ABI, don't needlessly break compatibility */
956 };
Definition: libwebsockets.h:952
+
Definition: libwebsockets.h:950
+
Definition: libwebsockets.h:951
+
+
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_ext_parse_options (const struct lws_extensionext,
struct lws * wsi,
void * ext_user,
const struct lws_ext_optionsopts,
const char * o,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_ext_parse_options() - deal with parsing negotiated extension options

+
Parameters
+ + + + + + + +
extrelated extension struct
wsiwebsocket connection
ext_userper-connection extension private data
optslist of supported options
ooption string to parse
lenlength
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_EXTERN int lws_extension_callback_pm_deflate (struct lws_context * context,
const struct lws_extensionext,
struct lws * wsi,
enum lws_extension_callback_reasons reason,
void * user,
void * in,
size_t len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_extension_callback_pm_deflate() - extension for RFC7692

+
Parameters
+ + + + + + + + +
contextlws context
extrelated lws_extension struct
wsiwebsocket connection
reasonincoming callback reason
userper-connection extension private data
inpointer parameter
lenlength parameter
+
+
+

Built-in callback implementing RFC7692 permessage-deflate

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_set_extension_option (struct lws * wsi,
const char * ext_name,
const char * opt_name,
const char * opt_val 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_set_extension_option(): set extension option if possible

+
Parameters
+ + + + + +
wsiwebsocket connection
ext_namename of ext, like "permessage-deflate"
opt_namename of option, like "rx_buf_size"
opt_valvalue to set option to
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__extensions.js b/doc/html/group__extensions.js new file mode 100644 index 00000000..c6ad3aeb --- /dev/null +++ b/doc/html/group__extensions.js @@ -0,0 +1,27 @@ +var group__extensions = +[ + [ "lws_ext_options", "structlws__ext__options.html", [ + [ "name", "structlws__ext__options.html#a1769e4a9805bbdda227821e9578ddc7e", null ], + [ "type", "structlws__ext__options.html#a7c4dbd62dbeba63a9d50d2306bd1cc61", null ] + ] ], + [ "lws_ext_option_arg", "structlws__ext__option__arg.html", [ + [ "len", "structlws__ext__option__arg.html#af37f0b6caa7735af51a1ac12b68d5bc5", null ], + [ "option_index", "structlws__ext__option__arg.html#af57fffcfa253dfa8d98681ac1fb1785f", null ], + [ "option_name", "structlws__ext__option__arg.html#a0a320c56b79271b8f059eeaad9423ac9", null ], + [ "start", "structlws__ext__option__arg.html#a0b1f7b30c3ceaf5f1bf9d105c24568d1", null ] + ] ], + [ "lws_extension", "structlws__extension.html", [ + [ "callback", "structlws__extension.html#afa21f3b3c8c2c9212a276c52b680c3af", null ], + [ "client_offer", "structlws__extension.html#a36b06c213aedb02bf9a402651751855b", null ], + [ "name", "structlws__extension.html#a1e5018c883d85176f5c2152176843f9e", null ] + ] ], + [ "lws_extension_callback_function", "group__extensions.html#gaae7169b2cd346b34fa33d0250db2afd0", null ], + [ "lws_ext_options_types", "group__extensions.html#gacc9f55936dc165257a2e1f7d47bce89e", [ + [ "EXTARG_NONE", "group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c", null ], + [ "EXTARG_DEC", "group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e", null ], + [ "EXTARG_OPT_DEC", "group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880", null ] + ] ], + [ "lws_ext_parse_options", "group__extensions.html#ga6fb3e2c3dfb9d64dc87026a4e99c128b", null ], + [ "lws_extension_callback_pm_deflate", "group__extensions.html#ga4cdbe42d872e21a448a947714d6c607e", null ], + [ "lws_set_extension_option", "group__extensions.html#gae0e24e1768f83a7fb07896ce975704b9", null ] +]; \ No newline at end of file diff --git a/doc/html/group__fops.html b/doc/html/group__fops.html new file mode 100644 index 00000000..05ac7855 --- /dev/null +++ b/doc/html/group__fops.html @@ -0,0 +1,124 @@ + + + + + + +libwebsockets: file operation wrapping + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
file operation wrapping
+
+
+ + + + +

+Data Structures

struct  lws_plat_file_ops
 
+ + + +

+Functions

LWS_VISIBLE LWS_EXTERN struct lws_plat_file_ops *LWS_WARN_UNUSED_RESULT lws_get_fops (struct lws_context *context)
 
+

Detailed Description

+

File operation wrapping

+

Use these helper functions if you want to access a file from the perspective of a specific wsi, which is usually the case. If you just want contextless file access, use the fops callbacks directly with NULL wsi instead of these helpers.

+

If so, then it calls the platform handler or user overrides where present (as defined in info->fops)

+

The advantage from all this is user code can be portable for file operations without having to deal with differences between platforms.

+

Function Documentation

+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws_plat_file_ops* LWS_WARN_UNUSED_RESULT lws_get_fops (struct lws_context * context)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_fops() - get current file ops

+
Parameters
+ + +
contextcontext
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__fops.js b/doc/html/group__fops.js new file mode 100644 index 00000000..9b6c64ab --- /dev/null +++ b/doc/html/group__fops.js @@ -0,0 +1,11 @@ +var group__fops = +[ + [ "lws_plat_file_ops", "structlws__plat__file__ops.html", [ + [ "close", "structlws__plat__file__ops.html#a034ec96f2fbaf52b4aa3e82d20795f7b", null ], + [ "open", "structlws__plat__file__ops.html#ad37a97abc68d0af967cef874f4d8df32", null ], + [ "read", "structlws__plat__file__ops.html#a01f483807a9862736b17ba9ed5110c40", null ], + [ "seek_cur", "structlws__plat__file__ops.html#abfcda19b003dcc13c61ff9e2bb4ff869", null ], + [ "write", "structlws__plat__file__ops.html#a1fae8330ee94649a3551e31a30809793", null ] + ] ], + [ "lws_get_fops", "group__fops.html#gac08aef64c4c34647ed699b24759b6b0e", null ] +]; \ No newline at end of file diff --git a/doc/html/group__form-parsing.html b/doc/html/group__form-parsing.html new file mode 100644 index 00000000..f40c0c6c --- /dev/null +++ b/doc/html/group__form-parsing.html @@ -0,0 +1,408 @@ + + + + + + +libwebsockets: Form Parsing + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Form Parsing
+
+
+ + + + +

+Typedefs

typedef int(* lws_spa_fileupload_cb) (void *data, const char *name, const char *filename, char *buf, int len, enum lws_spa_fileupload_states state)
 
+ + + +

+Enumerations

enum  lws_spa_fileupload_states { LWS_UFS_CONTENT, +LWS_UFS_FINAL_CONTENT, +LWS_UFS_OPEN + }
 
+ + + + + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN struct lws_spa * lws_spa_create (struct lws *wsi, const char *const *param_names, int count_params, int max_storage, lws_spa_fileupload_cb opt_cb, void *opt_data)
 
LWS_VISIBLE LWS_EXTERN int lws_spa_process (struct lws_spa *spa, const char *in, int len)
 
LWS_VISIBLE LWS_EXTERN int lws_spa_finalize (struct lws_spa *spa)
 
LWS_VISIBLE LWS_EXTERN int lws_spa_get_length (struct lws_spa *spa, int n)
 
LWS_VISIBLE LWS_EXTERN const char * lws_spa_get_string (struct lws_spa *spa, int n)
 
LWS_VISIBLE LWS_EXTERN int lws_spa_destroy (struct lws_spa *spa)
 
+

Detailed Description

+

POSTed form parsing functions

+

These lws_spa (stateful post arguments) apis let you parse and urldecode POSTed form arguments, both using simple urlencoded and multipart transfer encoding.

+

It's capable of handling file uploads as well a named input parsing, and the apis are the same for both form upload styles.

+

You feed it a list of parameter names and it creates pointers to the urldecoded arguments: file upload parameters pass the file data in chunks to a user-supplied callback as they come.

+

Since it's stateful, it handles the incoming data needing more than one POST_BODY callback and has no limit on uploaded file size.

+

Typedef Documentation

+ +
+
+ + + + +
typedef int(* lws_spa_fileupload_cb) (void *data, const char *name, const char *filename, char *buf, int len, enum lws_spa_fileupload_states state)
+
+ +

#include <lib/libwebsockets.h>

+

lws_spa_fileupload_cb() - callback to receive file upload data

+
Parameters
+ + + + + + + +
dataopt_data pointer set in lws_spa_create
namename of the form field being uploaded
filenameoriginal filename from client
bufstart of data to receive
lenlength of data to receive
stateinformation about how this call relates to file
+
+
+

Notice name and filename shouldn't be trusted, as they are passed from HTTP provided by the client.

+ +
+
+

Enumeration Type Documentation

+ +
+
+ + + + +
enum lws_spa_fileupload_states
+
+ +

#include <lib/libwebsockets.h>

+

enum lws_spa_fileupload_states

+ + + + +
Enumerator
LWS_UFS_CONTENT  +

a chunk of file content has arrived

+
LWS_UFS_FINAL_CONTENT  +

the last chunk (possibly zero length) of file content has arrived

+
LWS_UFS_OPEN  +

a new file is starting to arrive

+
+
2552  {
2557  LWS_UFS_OPEN
2559 };
Definition: libwebsockets.h:2555
+
Definition: libwebsockets.h:2557
+
Definition: libwebsockets.h:2553
+
+
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws_spa* lws_spa_create (struct lws * wsi,
const char *const * param_names,
int count_params,
int max_storage,
lws_spa_fileupload_cb opt_cb,
void * opt_data 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_spa_create() - create urldecode parser

+
Parameters
+ + + + + + + +
wsilws connection (used to find Content Type)
param_namesarray of form parameter names, like "username"
count_paramscount of param_names
max_storagetotal amount of form parameter values we can store
opt_cbNULL, or callback to receive file upload data.
opt_dataNULL, or user pointer provided to opt_cb.
+
+
+

Creates a urldecode parser and initializes it.

+

opt_cb can be NULL if you just want normal name=value parsing, however if one or more entries in your form are bulk data (file transfer), you can provide this callback and filter on the name callback parameter to treat that urldecoded data separately. The callback should return -1 in case of fatal error, and 0 if OK.

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_spa_destroy (struct lws_spa * spa)
+
+ +

#include <lib/libwebsockets.h>

+

lws_spa_destroy() - destroy parser object

+
Parameters
+ + +
spathe parser object previously created
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_spa_finalize (struct lws_spa * spa)
+
+ +

#include <lib/libwebsockets.h>

+

lws_spa_finalize() - indicate incoming data completed

+
Parameters
+ + +
spathe parser object previously created
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_spa_get_length (struct lws_spa * spa,
int n 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_spa_get_length() - return length of parameter value

+
Parameters
+ + + +
spathe parser object previously created
nparameter ordinal to return length of value for
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN const char* lws_spa_get_string (struct lws_spa * spa,
int n 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_spa_get_string() - return pointer to parameter value

Parameters
+ + + +
spathe parser object previously created
nparameter ordinal to return pointer to value for
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_spa_process (struct lws_spa * spa,
const char * in,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_spa_process() - parses a chunk of input data

+
Parameters
+ + + + + +
spathe parser object previously created
inincoming, urlencoded data
lencount of bytes valid at
in
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__form-parsing.js b/doc/html/group__form-parsing.js new file mode 100644 index 00000000..4c7dd8e4 --- /dev/null +++ b/doc/html/group__form-parsing.js @@ -0,0 +1,15 @@ +var group__form_parsing = +[ + [ "lws_spa_fileupload_cb", "group__form-parsing.html#ga5a70527c0861c2ffa3d29333a6aa7f8e", null ], + [ "lws_spa_fileupload_states", "group__form-parsing.html#ga41a74a822771d3dce89751aa3bce28ae", [ + [ "LWS_UFS_CONTENT", "group__form-parsing.html#gga41a74a822771d3dce89751aa3bce28aead3a958e7719ac273c3ba4f684f00c87f", null ], + [ "LWS_UFS_FINAL_CONTENT", "group__form-parsing.html#gga41a74a822771d3dce89751aa3bce28aea6ce2a55a4c3695cdb640c893d95bd3a7", null ], + [ "LWS_UFS_OPEN", "group__form-parsing.html#gga41a74a822771d3dce89751aa3bce28aea2d25de44865bd44e5a3903a2bab9ca83", null ] + ] ], + [ "lws_spa_create", "group__form-parsing.html#ga162f86762173a2bc8c28497941d74815", null ], + [ "lws_spa_destroy", "group__form-parsing.html#gaaa482f07dad3f04b391cccf0a814e13b", null ], + [ "lws_spa_finalize", "group__form-parsing.html#ga83835bf250ee3d4a60f36a182f2b8d24", null ], + [ "lws_spa_get_length", "group__form-parsing.html#ga3fbe378632f85ec9a14cc2c1687bf05f", null ], + [ "lws_spa_get_string", "group__form-parsing.html#ga2da476217166da02704b90d3a8d4f3cd", null ], + [ "lws_spa_process", "group__form-parsing.html#ga9ad9ebf5ea1a7108415ed7e04cb231d2", null ] +]; \ No newline at end of file diff --git a/doc/html/group__generic-sessions.html b/doc/html/group__generic-sessions.html new file mode 100644 index 00000000..0488d79e --- /dev/null +++ b/doc/html/group__generic-sessions.html @@ -0,0 +1,169 @@ + + + + + + +libwebsockets: plugin: generic-sessions + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
plugin: generic-sessions
+
+
+ + + + + + + + + + +

+Data Structures

struct  lwsgw_hash_bin
 
struct  lwsgw_hash
 
struct  lws_session_info
 
struct  lws_gs_event_args
 
+ + + + + +

+Enumerations

enum  lwsgs_auth_bits { LWSGS_AUTH_LOGGED_IN = 1, +LWSGS_AUTH_ADMIN = 2, +LWSGS_AUTH_VERIFIED = 4, +LWSGS_AUTH_FORGOT_FLOW = 8 + }
 
enum  lws_gs_event { LWSGSE_CREATED, +LWSGSE_DELETED + }
 
+

Detailed Description

+

Plugin Generic-sessions related

+

generic-sessions plugin provides a reusable, generic session and login / register / forgot password framework including email verification.

+

Enumeration Type Documentation

+ +
+
+ + + + +
enum lws_gs_event
+
+ +

#include <lib/libwebsockets.h>

+

enum lws_gs_event

+ + + +
Enumerator
LWSGSE_CREATED  +

a new user was created

+
LWSGSE_DELETED  +

an existing user was deleted

+
+
1311  {
1312  LWSGSE_CREATED,
1314 };
Definition: libwebsockets.h:1313
+
Definition: libwebsockets.h:1312
+
+
+
+ +
+
+ + + + +
enum lwsgs_auth_bits
+
+ +

#include <lib/libwebsockets.h>

+

enum lwsgs_auth_bits

+ + + + + +
Enumerator
LWSGS_AUTH_LOGGED_IN  +

user is logged in as somebody

+
LWSGS_AUTH_ADMIN  +

logged in as the admin user

+
LWSGS_AUTH_VERIFIED  +

user has verified his email

+
LWSGS_AUTH_FORGOT_FLOW  +

he just completed "forgot password" flow

+
+
1293  {
1294  LWSGS_AUTH_LOGGED_IN = 1,
1295  LWSGS_AUTH_ADMIN = 2,
1296  LWSGS_AUTH_VERIFIED = 4,
1298 };
Definition: libwebsockets.h:1296
+
Definition: libwebsockets.h:1297
+
Definition: libwebsockets.h:1295
+
Definition: libwebsockets.h:1294
+
+
+
+
+
+ + + + diff --git a/doc/html/group__generic-sessions.js b/doc/html/group__generic-sessions.js new file mode 100644 index 00000000..10f908fe --- /dev/null +++ b/doc/html/group__generic-sessions.js @@ -0,0 +1,31 @@ +var group__generic_sessions = +[ + [ "lwsgw_hash_bin", "structlwsgw__hash__bin.html", [ + [ "bin", "structlwsgw__hash__bin.html#ac92f50d9471058525d110597a4e0de6b", null ] + ] ], + [ "lwsgw_hash", "structlwsgw__hash.html", [ + [ "id", "structlwsgw__hash.html#a29435f5cf78747d4257695b0f141d164", null ] + ] ], + [ "lws_session_info", "structlws__session__info.html", [ + [ "email", "structlws__session__info.html#a94b813cfc6b0da4b182659de30038ad3", null ], + [ "ip", "structlws__session__info.html#a53eed02325e8717a53297391e3e98fac", null ], + [ "mask", "structlws__session__info.html#afb924864b70f40372920688a5c1c895e", null ], + [ "session", "structlws__session__info.html#a4353b5dd19400b2b15edfd7cee1e4cd5", null ], + [ "username", "structlws__session__info.html#a3d57a70b6e7181d95a8bec429b1a7697", null ] + ] ], + [ "lws_gs_event_args", "structlws__gs__event__args.html", [ + [ "email", "structlws__gs__event__args.html#acd17e4f9f91f7f9a8f0fbf0744a3a463", null ], + [ "event", "structlws__gs__event__args.html#a477274f8ca22ba7411b9285b9dc8dd06", null ], + [ "username", "structlws__gs__event__args.html#a2bec693d8a43730d487004a44326178b", null ] + ] ], + [ "lws_gs_event", "group__generic-sessions.html#gaa93946b3d921072209d5cd8cdfa5332e", [ + [ "LWSGSE_CREATED", "group__generic-sessions.html#ggaa93946b3d921072209d5cd8cdfa5332ea596010a165bf13473c5eea3a34cd4308", null ], + [ "LWSGSE_DELETED", "group__generic-sessions.html#ggaa93946b3d921072209d5cd8cdfa5332ead908cdc5689c5d22c9d3c8934e94dcde", null ] + ] ], + [ "lwsgs_auth_bits", "group__generic-sessions.html#ga7c2dc7bfb4ccb91c5d771f9e9ea237e1", [ + [ "LWSGS_AUTH_LOGGED_IN", "group__generic-sessions.html#gga7c2dc7bfb4ccb91c5d771f9e9ea237e1a81e63075115dedd150265d81b8f7fa57", null ], + [ "LWSGS_AUTH_ADMIN", "group__generic-sessions.html#gga7c2dc7bfb4ccb91c5d771f9e9ea237e1a0657a9e846814781b128c397fe4b10bf", null ], + [ "LWSGS_AUTH_VERIFIED", "group__generic-sessions.html#gga7c2dc7bfb4ccb91c5d771f9e9ea237e1a5a607e4668d20cadada62c4b8007f887", null ], + [ "LWSGS_AUTH_FORGOT_FLOW", "group__generic-sessions.html#gga7c2dc7bfb4ccb91c5d771f9e9ea237e1a2cd8fb86e3b85c106e7711c03f0ddd0a", null ] + ] ] +]; \ No newline at end of file diff --git a/doc/html/group__html-chunked-substitution.html b/doc/html/group__html-chunked-substitution.html new file mode 100644 index 00000000..42e9470d --- /dev/null +++ b/doc/html/group__html-chunked-substitution.html @@ -0,0 +1,185 @@ + + + + + + +libwebsockets: HTML Chunked Substitution + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
HTML Chunked Substitution
+
+
+ + + + + + +

+Data Structures

struct  lws_process_html_args
 
struct  lws_process_html_state
 
+ + + +

+Typedefs

+typedef const char *(* lws_process_html_state_cb) (void *data, int index)
 
+ + + +

+Enumerations

enum  http_status {
+  HTTP_STATUS_OK = 200, +HTTP_STATUS_NO_CONTENT = 204, +HTTP_STATUS_MOVED_PERMANENTLY = 301, +HTTP_STATUS_FOUND = 302, +
+  HTTP_STATUS_SEE_OTHER = 303, +HTTP_STATUS_BAD_REQUEST = 400, +HTTP_STATUS_UNAUTHORIZED, +HTTP_STATUS_PAYMENT_REQUIRED, +
+  HTTP_STATUS_FORBIDDEN, +HTTP_STATUS_NOT_FOUND, +HTTP_STATUS_METHOD_NOT_ALLOWED, +HTTP_STATUS_NOT_ACCEPTABLE, +
+  HTTP_STATUS_PROXY_AUTH_REQUIRED, +HTTP_STATUS_REQUEST_TIMEOUT, +HTTP_STATUS_CONFLICT, +HTTP_STATUS_GONE, +
+  HTTP_STATUS_LENGTH_REQUIRED, +HTTP_STATUS_PRECONDITION_FAILED, +HTTP_STATUS_REQ_ENTITY_TOO_LARGE, +HTTP_STATUS_REQ_URI_TOO_LONG, +
+  HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE, +HTTP_STATUS_REQ_RANGE_NOT_SATISFIABLE, +HTTP_STATUS_EXPECTATION_FAILED, +HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, +
+  HTTP_STATUS_NOT_IMPLEMENTED, +HTTP_STATUS_BAD_GATEWAY, +HTTP_STATUS_SERVICE_UNAVAILABLE, +HTTP_STATUS_GATEWAY_TIMEOUT, +
+  HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED +
+ }
 
+ + + +

+Functions

LWS_VISIBLE LWS_EXTERN int lws_chunked_html_process (struct lws_process_html_args *args, struct lws_process_html_state *s)
 
+

Detailed Description

+

HTML chunked Substitution

+

APIs for receiving chunks of text, replacing a set of variable names via a callback, and then prepending and appending HTML chunked encoding headers.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_chunked_html_process (struct lws_process_html_argsargs,
struct lws_process_html_states 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_chunked_html_process() - generic chunked substitution

Parameters
+ + + +
argsbuffer to process using chunked encoding
scurrent processing state
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__html-chunked-substitution.js b/doc/html/group__html-chunked-substitution.js new file mode 100644 index 00000000..49e9819d --- /dev/null +++ b/doc/html/group__html-chunked-substitution.js @@ -0,0 +1,19 @@ +var group__html_chunked_substitution = +[ + [ "lws_process_html_args", "structlws__process__html__args.html", [ + [ "final", "structlws__process__html__args.html#a362547891ee0d693f3900a1f807ea475", null ], + [ "len", "structlws__process__html__args.html#a754513f2311241cabb0cd1c90d7307ef", null ], + [ "max_len", "structlws__process__html__args.html#a8be7fd396a1942ea2449a2fda990ff99", null ], + [ "p", "structlws__process__html__args.html#a11859d8bedd379fbf64543b25c65fe14", null ] + ] ], + [ "lws_process_html_state", "structlws__process__html__state.html", [ + [ "count_vars", "structlws__process__html__state.html#adcafd17704775b4bbeea9561fb340968", null ], + [ "data", "structlws__process__html__state.html#af21119890fdfebe28fb5c4dabfc1bdf5", null ], + [ "pos", "structlws__process__html__state.html#a53234f2948812c7208a256f9f5b23c20", null ], + [ "replace", "structlws__process__html__state.html#a693d2fb45378afee5da29b539c1ea644", null ], + [ "start", "structlws__process__html__state.html#af0732884ef891e24fe5fa237ebaa21a3", null ], + [ "swallow", "structlws__process__html__state.html#a71982bc1cbd8cf876ca0f545144404eb", null ], + [ "vars", "structlws__process__html__state.html#a3b113e00c03a2fded51b1c85ff5bf077", null ] + ] ], + [ "lws_chunked_html_process", "group__html-chunked-substitution.html#ga643073f918c0a7016b690aae9793fd60", null ] +]; \ No newline at end of file diff --git a/doc/html/group__http.html b/doc/html/group__http.html new file mode 100644 index 00000000..17ae9319 --- /dev/null +++ b/doc/html/group__http.html @@ -0,0 +1,249 @@ + + + + + + +libwebsockets: HTTP + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
HTTP
+
+
+ + + + + + + + + + + + + + +

+Modules

 Form Parsing
 
 HTML Chunked Substitution
 
 HTTP File transfer
 
 HTTP headers: create
 
 HTTP headers: read
 
 Urlencode and Urldecode
 
+ + + +

+Data Structures

struct  lws_tokens
 
+ + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN int lws_return_http_status (struct lws *wsi, unsigned int code, const char *html_body)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_http_redirect (struct lws *wsi, int code, const unsigned char *loc, int len, unsigned char **p, unsigned char *end)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_http_transaction_completed (struct lws *wsi)
 
+

Detailed Description

+

Modules related to handling HTTP

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_http_redirect (struct lws * wsi,
int code,
const unsigned char * loc,
int len,
unsigned char ** p,
unsigned char * end 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_http_redirect() - write http redirect into buffer

+
Parameters
+ + + + + + + +
wsiwebsocket connection
codeHTTP response code (eg, 301)
locwhere to redirect to
lenlength of loc
ppointer current position in buffer (updated as we write)
endpointer to end of buffer
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_http_transaction_completed (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_http_transaction_completed() - wait for new http transaction or close

Parameters
+ + +
wsiwebsocket connection
 Returns 1 if the HTTP connection must close now
+ Returns 0 and resets connection to wait for new HTTP header /
+   transaction if possible
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_return_http_status (struct lws * wsi,
unsigned int code,
const char * html_body 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_return_http_status() - Return simple http status

Parameters
+ + + + +
wsiWebsocket instance (available from user callback)
codeStatus index, eg, 404
html_bodyUser-readable HTML description < 1KB, or NULL
 Helper to report HTTP errors back to the client cleanly and
+ consistently
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__http.js b/doc/html/group__http.js new file mode 100644 index 00000000..1202f4ba --- /dev/null +++ b/doc/html/group__http.js @@ -0,0 +1,16 @@ +var group__http = +[ + [ "Form Parsing", "group__form-parsing.html", "group__form-parsing" ], + [ "HTML Chunked Substitution", "group__html-chunked-substitution.html", "group__html-chunked-substitution" ], + [ "HTTP File transfer", "group__httpft.html", "group__httpft" ], + [ "HTTP headers: create", "group__HTTP-headers-create.html", "group__HTTP-headers-create" ], + [ "HTTP headers: read", "group__HTTP-headers-read.html", "group__HTTP-headers-read" ], + [ "Urlencode and Urldecode", "group__urlendec.html", "group__urlendec" ], + [ "lws_tokens", "structlws__tokens.html", [ + [ "token", "structlws__tokens.html#a9f3635412bc71a5cb78e9862b55f10cd", null ], + [ "token_len", "structlws__tokens.html#a855b7375d1d58516c0ecd4b60e9a7766", null ] + ] ], + [ "lws_http_redirect", "group__http.html#ga8fbf01e473ac421fc33ad9f8da8b8a25", null ], + [ "lws_http_transaction_completed", "group__http.html#gad27aed6c66a41b2b89ffe4da2a309e8a", null ], + [ "lws_return_http_status", "group__http.html#gac8a4a71240857dc6b2ed70456b6923f4", null ] +]; \ No newline at end of file diff --git a/doc/html/group__httpft.html b/doc/html/group__httpft.html new file mode 100644 index 00000000..81e6a784 --- /dev/null +++ b/doc/html/group__httpft.html @@ -0,0 +1,157 @@ + + + + + + +libwebsockets: HTTP File transfer + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
HTTP File transfer
+
+
+ + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN int lws_serve_http_file (struct lws *wsi, const char *file, const char *content_type, const char *other_headers, int other_headers_len)
 
+LWS_VISIBLE LWS_EXTERN int lws_serve_http_file_fragment (struct lws *wsi)
 
+

Detailed Description

+

APIs for sending local files in response to HTTP requests

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_serve_http_file (struct lws * wsi,
const char * file,
const char * content_type,
const char * other_headers,
int other_headers_len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_serve_http_file() - Send a file back to the client using http

Parameters
+ + + + + + +
wsiWebsocket instance (available from user callback)
fileThe file to issue over http
content_typeThe http content type, eg, text/html
other_headersNULL or pointer to header string
other_headers_lenlength of the other headers if non-NULL
 This function is intended to be called from the callback in response
+ to http requests from the client.  It allows the callback to issue
+ local files down the http link in a single step.
+
+ Returning <0 indicates error and the wsi should be closed.  Returning
+ >0 indicates the file was completely sent and
+ lws_http_transaction_completed() called on the wsi (and close if != 0)
+ ==0 indicates the file transfer is started and needs more service later,
+ the wsi should be left alone.
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__httpft.js b/doc/html/group__httpft.js new file mode 100644 index 00000000..7a2c2946 --- /dev/null +++ b/doc/html/group__httpft.js @@ -0,0 +1,4 @@ +var group__httpft = +[ + [ "lws_serve_http_file", "group__httpft.html#gab393a06d3d2722af4c3f8b06842c80d7", null ] +]; \ No newline at end of file diff --git a/doc/html/group__log.html b/doc/html/group__log.html new file mode 100644 index 00000000..89053300 --- /dev/null +++ b/doc/html/group__log.html @@ -0,0 +1,278 @@ + + + + + + +libwebsockets: Logging + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Logging
+
+
+ + + + +

+Enumerations

enum  lws_log_levels {
+  LLL_ERR = 1 << 0, +LLL_WARN = 1 << 1, +LLL_NOTICE = 1 << 2, +LLL_INFO = 1 << 3, +
+  LLL_DEBUG = 1 << 4, +LLL_PARSER = 1 << 5, +LLL_HEADER = 1 << 6, +LLL_EXT = 1 << 7, +
+  LLL_CLIENT = 1 << 8, +LLL_LATENCY = 1 << 9, +LLL_COUNT = 10 +
+ }
 
+ + + + + + + + + + + + + +

+Functions

+LWS_VISIBLE LWS_EXTERN void _lws_log (int filter, const char *format,...)
 
+LWS_VISIBLE LWS_EXTERN void _lws_logv (int filter, const char *format, va_list vl)
 
LWS_VISIBLE LWS_EXTERN int lwsl_timestamp (int level, char *p, int len)
 
LWS_VISIBLE LWS_EXTERN void lwsl_hexdump (void *buf, size_t len)
 
LWS_VISIBLE LWS_EXTERN void lws_set_log_level (int level, void(*log_emit_function)(int level, const char *line))
 
LWS_VISIBLE LWS_EXTERN void lwsl_emit_syslog (int level, const char *line)
 
+

Detailed Description

+

Logging

+

Lws provides flexible and filterable logging facilities, which can be used inside lws and in user code.

+

Log categories may be individually filtered bitwise, and directed to built-in sinks for syslog-compatible logging, or a user-defined function.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lws_set_log_level (int level,
void(*)(int level, const char *line) log_emit_function 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_set_log_level() - Set the logging bitfield

Parameters
+ + + +
levelOR together the LLL_ debug contexts you want output from
log_emit_functionNULL to leave it as it is, or a user-supplied function to perform log string emission instead of the default stderr one.
+
+
+

log level defaults to "err", "warn" and "notice" contexts enabled and emission on stderr.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lwsl_emit_syslog (int level,
const char * line 
)
+
+ +

#include <lib/libwebsockets.h>

+

lwsl_emit_syslog() - helper log emit function writes to system log

+
Parameters
+ + + +
levelone of LLL_ log level indexes
linelog string
+
+
+

You use this by passing the function pointer to lws_set_log_level(), to set it as the log emit function, it is not called directly.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lwsl_hexdump (void * buf,
size_t len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lwsl_hexdump() - helper to hexdump a buffer (DEBUG builds only)

+
Parameters
+ + + +
bufbuffer start to dump
lenlength of buffer to dump
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lwsl_timestamp (int level,
char * p,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lwsl_timestamp: generate logging timestamp string

+
Parameters
+ + + + +
levellogging level
pchar * buffer to take timestamp
lenlength of p
+
+
+

returns length written in p

+ +
+
+
+
+ + + + diff --git a/doc/html/group__log.js b/doc/html/group__log.js new file mode 100644 index 00000000..e220377f --- /dev/null +++ b/doc/html/group__log.js @@ -0,0 +1,7 @@ +var group__log = +[ + [ "lws_set_log_level", "group__log.html#ga244647f9e1bf0097ccdde66d74f41e26", null ], + [ "lwsl_emit_syslog", "group__log.html#gab7c0fc936cc9f1eb58e2bb234c15147c", null ], + [ "lwsl_hexdump", "group__log.html#ga898b1f03872ad019f507d4e35bbefa90", null ], + [ "lwsl_timestamp", "group__log.html#ga42e39775c6b69b7251bdbf5a2cdd5dcd", null ] +]; \ No newline at end of file diff --git a/doc/html/group__misc.html b/doc/html/group__misc.html new file mode 100644 index 00000000..205bb2e4 --- /dev/null +++ b/doc/html/group__misc.html @@ -0,0 +1,432 @@ + + + + + + +libwebsockets: Miscellaneous APIs + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Miscellaneous APIs
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN int lws_get_random (struct lws_context *context, void *buf, int len)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_daemonize (const char *_lock_path)
 
LWS_VISIBLE LWS_EXTERN const char *LWS_WARN_UNUSED_RESULT lws_get_library_version (void)
 
LWS_VISIBLE LWS_EXTERN void * lws_wsi_user (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_parse_uri (char *p, const char **prot, const char **ads, int *port, const char **path)
 
LWS_VISIBLE LWS_EXTERN unsigned long lws_now_secs (void)
 
LWS_VISIBLE LWS_EXTERN struct lws_context *LWS_WARN_UNUSED_RESULT lws_get_context (const struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_get_count_threads (struct lws_context *context)
 
LWS_VISIBLE LWS_EXTERN struct lws *LWS_WARN_UNUSED_RESULT lws_get_parent (const struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN struct lws *LWS_WARN_UNUSED_RESULT lws_get_child (const struct lws *wsi)
 
+LWS_VISIBLE LWS_EXTERN int lws_read (struct lws *wsi, unsigned char *buf, size_t len)
 
LWS_VISIBLE LWS_EXTERN void lws_set_allocator (void *(*realloc)(void *ptr, size_t size))
 
+

Detailed Description

+

Miscellaneous APIs

+

Various APIs outside of other categories

+

Function Documentation

+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_daemonize (const char * _lock_path)
+
+ +

#include <lib/libwebsockets.h>

+

lws_daemonize(): fill a buffer with platform random data

+
Parameters
+ + +
_lock_paththe filepath to write the lock file
+
+
+

Spawn lws as a background process, taking care of various things

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws* LWS_WARN_UNUSED_RESULT lws_get_child (const struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_child() - get child wsi or NULL

Parameters
+ + +
wsilws connection
+
+
+

Allows you to find a related wsi from the parent wsi.

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws_context* LWS_WARN_UNUSED_RESULT lws_get_context (const struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_context - Allow geting lws_context from a Websocket connection instance

+

With this function, users can access context in the callback function. Otherwise users may have to declare context as a global variable.

+
Parameters
+ + +
wsiWebsocket connection instance
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_get_count_threads (struct lws_context * context)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_count_threads(): how many service threads the context uses

+
Parameters
+ + +
contextthe lws context
+
+
+

By default this is always 1, if you asked for more than lws can handle it will clip the number of threads. So you can use this to find out how many threads are actually in use.

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN const char* LWS_WARN_UNUSED_RESULT lws_get_library_version (void )
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_library_version(): return string describing the version of lws

+

On unix, also includes the git describe

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws* LWS_WARN_UNUSED_RESULT lws_get_parent (const struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_parent() - get parent wsi or NULL

Parameters
+ + +
wsilws connection
+
+
+

Specialized wsi like cgi stdin/out/err are associated to a parent wsi, this allows you to get their parent.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_get_random (struct lws_context * context,
void * buf,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_random(): fill a buffer with platform random data

+
Parameters
+ + + + +
contextthe lws context
bufbuffer to fill
lenhow much to fill
+
+
+

This is intended to be called from the LWS_CALLBACK_RECEIVE callback if it's interested to see if the frame it's dealing with was sent in binary mode.

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN unsigned long lws_now_secs (void )
+
+ +

#include <lib/libwebsockets.h>

+

lws_now_secs(): return seconds since 1970-1-1

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_parse_uri (char * p,
const char ** prot,
const char ** ads,
int * port,
const char ** path 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_parse_uri: cut up prot:/ads:port/path into pieces Notice it does so by dropping '\0' into input string and the leading / on the path is consequently lost

+
Parameters
+ + + + + + +
pincoming uri string.. will get written to
protresult pointer for protocol part (https://)
adsresult pointer for address part
portresult pointer for port part
pathresult pointer for path part
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lws_set_allocator (void *(*)(void *ptr, size_t size) realloc)
+
+ +

#include <lib/libwebsockets.h>

+

lws_set_allocator() - custom allocator support

+
Parameters
+ + +
reallocAllows you to replace the allocator (and deallocator) used by lws
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN void* lws_wsi_user (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_wsi_user() - get the user data associated with the connection

Parameters
+ + +
wsilws connection
+
+
+

Not normally needed since it's passed into the callback

+ +
+
+
+
+ + + + diff --git a/doc/html/group__misc.js b/doc/html/group__misc.js new file mode 100644 index 00000000..de8f7d03 --- /dev/null +++ b/doc/html/group__misc.js @@ -0,0 +1,14 @@ +var group__misc = +[ + [ "lws_daemonize", "group__misc.html#gace5171b1dbbc03ec89a98f8afdb5c9af", null ], + [ "lws_get_child", "group__misc.html#gacae4d7b6a8d22e4c2d82ff8b12c1e234", null ], + [ "lws_get_context", "group__misc.html#ga0af4f7d2dd375aeedcfa7eb0e1101c4b", null ], + [ "lws_get_count_threads", "group__misc.html#ga629f48268fd1856b54b11172991b97d9", null ], + [ "lws_get_library_version", "group__misc.html#gac6abfc0b2bd5b2f09281a4432bb2f5f0", null ], + [ "lws_get_parent", "group__misc.html#ga8930fe36a3f3eefe4a6a4fd499d8e899", null ], + [ "lws_get_random", "group__misc.html#ga58f906c6be0ca80efd813f694569dd4a", null ], + [ "lws_now_secs", "group__misc.html#ga33bf2635033710b25f931b57ed663e1e", null ], + [ "lws_parse_uri", "group__misc.html#ga1ec0d9faac5d3a5824d765c287c043aa", null ], + [ "lws_set_allocator", "group__misc.html#gab321ed812f46f6dc7ef9e3ca6f00cf1b", null ], + [ "lws_wsi_user", "group__misc.html#gaa194584fff9698f3b280658f770ccd0f", null ] +]; \ No newline at end of file diff --git a/doc/html/group__net.html b/doc/html/group__net.html new file mode 100644 index 00000000..fceb76b3 --- /dev/null +++ b/doc/html/group__net.html @@ -0,0 +1,284 @@ + + + + + + +libwebsockets: Network related helper APIs + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Network related helper APIs
+
+
+ + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN const char *LWS_WARN_UNUSED_RESULT lws_canonical_hostname (struct lws_context *context)
 
LWS_VISIBLE LWS_EXTERN void lws_get_peer_addresses (struct lws *wsi, lws_sockfd_type fd, char *name, int name_len, char *rip, int rip_len)
 
LWS_VISIBLE LWS_EXTERN const char * lws_get_peer_simple (struct lws *wsi, char *name, int namelen)
 
LWS_VISIBLE LWS_EXTERN int lws_interface_to_sa (int ipv6, const char *ifname, struct sockaddr_in *addr, size_t addrlen)
 
+

Detailed Description

+

Network related helper APIs

+

These wrap miscellaneous useful network-related functions

+

Function Documentation

+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN const char* LWS_WARN_UNUSED_RESULT lws_canonical_hostname (struct lws_context * context)
+
+ +

#include <lib/libwebsockets.h>

+

lws_canonical_hostname() - returns this host's hostname

+

This is typically used by client code to fill in the host parameter when making a client connection. You can only call it after the context has been created.

+
Parameters
+ + +
contextWebsocket context
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lws_get_peer_addresses (struct lws * wsi,
lws_sockfd_type fd,
char * name,
int name_len,
char * rip,
int rip_len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_peer_addresses() - Get client address information

Parameters
+ + + + + + + +
wsiLocal struct lws associated with
fdConnection socket descriptor
nameBuffer to take client address name
name_lenLength of client address name buffer
ripBuffer to take client address IP dotted quad
rip_lenLength of client address IP buffer
 This function fills in name and rip with the name and IP of
+ the client connected with socket descriptor fd.  Names may be
+ truncated if there is not enough room.  If either cannot be
+ determined, they will be returned as valid zero-length strings.
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN const char* lws_get_peer_simple (struct lws * wsi,
char * name,
int namelen 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_peer_simple() - Get client address information without RDNS

+
Parameters
+ + + + +
wsiLocal struct lws associated with
nameBuffer to take client address name
namelenLength of client address name buffer
+
+
+

This provides a 123.123.123.123 type IP address in name from the peer that has connected to wsi

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_interface_to_sa (int ipv6,
const char * ifname,
struct sockaddr_in * addr,
size_t addrlen 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_interface_to_sa() - Convert interface name or IP to sockaddr struct

+
Parameters
+ + + + + +
ipv6Allow IPV6 addresses
ifnameInterface name or IP
addrstruct sockaddr_in * to be written
addrlenLength of addr
+
+
+

This converts a textual network interface name to a sockaddr usable by other network functions

+ +
+
+
+
+ + + + diff --git a/doc/html/group__net.js b/doc/html/group__net.js new file mode 100644 index 00000000..1b5a3498 --- /dev/null +++ b/doc/html/group__net.js @@ -0,0 +1,7 @@ +var group__net = +[ + [ "lws_canonical_hostname", "group__net.html#gad0df22db2be9fc65a667a1e83f9a92a4", null ], + [ "lws_get_peer_addresses", "group__net.html#ga092e5f473b3347f03ffeef8a950080f3", null ], + [ "lws_get_peer_simple", "group__net.html#gad01014fed09759741b6d23afccfdaacc", null ], + [ "lws_interface_to_sa", "group__net.html#ga869d8bdffb0f2a7ce08e3ce10d6be3d8", null ] +]; \ No newline at end of file diff --git a/doc/html/group__pur.html b/doc/html/group__pur.html new file mode 100644 index 00000000..5bff06bc --- /dev/null +++ b/doc/html/group__pur.html @@ -0,0 +1,181 @@ + + + + + + +libwebsockets: Sanitize / purify SQL and JSON helpers + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Sanitize / purify SQL and JSON helpers
+
+
+ + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN const char * lws_sql_purify (char *escaped, const char *string, int len)
 
LWS_VISIBLE LWS_EXTERN const char * lws_json_purify (char *escaped, const char *string, int len)
 
+

Detailed Description

+

Sanitize / purify SQL and JSON helpers

+

APIs for escaping untrusted JSON and SQL safely before use

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN const char* lws_json_purify (char * escaped,
const char * string,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_json_purify() - like strncpy but with escaping for json chars

+
Parameters
+ + + + +
escapedoutput buffer
stringinput buffer ('/0' terminated)
lenoutput buffer max length
+
+
+

Because escaping expands the output string, it's not possible to do it in-place, ie, with escaped == string

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN const char* lws_sql_purify (char * escaped,
const char * string,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_sql_purify() - like strncpy but with escaping for sql quotes

+
Parameters
+ + + + +
escapedoutput buffer
stringinput buffer ('/0' terminated)
lenoutput buffer max length
+
+
+

Because escaping expands the output string, it's not possible to do it in-place, ie, with escaped == string

+ +
+
+
+
+ + + + diff --git a/doc/html/group__pur.js b/doc/html/group__pur.js new file mode 100644 index 00000000..5fe61ace --- /dev/null +++ b/doc/html/group__pur.js @@ -0,0 +1,5 @@ +var group__pur = +[ + [ "lws_json_purify", "group__pur.html#gab15187efcfa256b7c928562c182b92a3", null ], + [ "lws_sql_purify", "group__pur.html#ga9cc82f06e5ae7e71458626d7a39a5865", null ] +]; \ No newline at end of file diff --git a/doc/html/group__sending-data.html b/doc/html/group__sending-data.html new file mode 100644 index 00000000..2e9d89e4 --- /dev/null +++ b/doc/html/group__sending-data.html @@ -0,0 +1,226 @@ + + + + + + +libwebsockets: Sending data + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Sending data
+
+
+ + + + +

+Enumerations

enum  lws_write_protocol {
+  LWS_WRITE_TEXT = 0, +LWS_WRITE_BINARY = 1, +LWS_WRITE_CONTINUATION = 2, +LWS_WRITE_HTTP = 3, +
+  LWS_WRITE_PING = 5, +LWS_WRITE_PONG = 6, +LWS_WRITE_HTTP_FINAL = 7, +LWS_WRITE_HTTP_HEADERS = 8, +
+  LWS_WRITE_NO_FIN = 0x40, +LWS_WRITE_CLIENT_IGNORE_XOR_MASK = 0x80 +
+ }
 
+ + + +

+Functions

LWS_VISIBLE LWS_EXTERN int lws_write (struct lws *wsi, unsigned char *buf, size_t len, enum lws_write_protocol protocol)
 
+

Detailed Description

+

APIs related to writing data on a connection

+

Enumeration Type Documentation

+ +
+
+ + + + +
enum lws_write_protocol
+
+ +

#include <lib/libwebsockets.h>

+ + + + + + + + +
Enumerator
LWS_WRITE_TEXT  +

Send a ws TEXT message,the pointer must have LWS_PRE valid memory behind it. The receiver expects only valid utf-8 in the payload

+
LWS_WRITE_BINARY  +

Send a ws BINARY message, the pointer must have LWS_PRE valid memory behind it. Any sequence of bytes is valid

+
LWS_WRITE_CONTINUATION  +

Continue a previous ws message, the pointer must have LWS_PRE valid memory behind it

+
LWS_WRITE_HTTP  +

Send HTTP content

+
LWS_WRITE_HTTP_HEADERS  +

Send http headers (http2 encodes this payload and LWS_WRITE_HTTP payload differently, http 1.x links also handle this correctly. so to be compatible with both in the future,header response part should be sent using this regardless of http version expected)

+
LWS_WRITE_NO_FIN  +

This part of the message is not the end of the message

+
LWS_WRITE_CLIENT_IGNORE_XOR_MASK  +

client packet payload goes out on wire unmunged only useful for security tests since normal servers cannot decode the content if used

+
+
2893  {
2894  LWS_WRITE_TEXT = 0,
2898  LWS_WRITE_BINARY = 1,
2904  LWS_WRITE_HTTP = 3,
2907  /* LWS_WRITE_CLOSE is handled by lws_close_reason() */
2908  LWS_WRITE_PING = 5,
2909  LWS_WRITE_PONG = 6,
2910 
2911  /* Same as write_http but we know this write ends the transaction */
2912  LWS_WRITE_HTTP_FINAL = 7,
2913 
2914  /* HTTP2 */
2915 
2923  /****** add new things just above ---^ ******/
2924 
2925  /* flags */
2926 
2927  LWS_WRITE_NO_FIN = 0x40,
2934 };
Definition: libwebsockets.h:2904
+
Definition: libwebsockets.h:2927
+
Definition: libwebsockets.h:2894
+
Definition: libwebsockets.h:2898
+
Definition: libwebsockets.h:2930
+
Definition: libwebsockets.h:2901
+
Definition: libwebsockets.h:2916
+
+
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_write (struct lws * wsi,
unsigned char * buf,
size_t len,
enum lws_write_protocol protocol 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_write() - Apply protocol then write data to client

Parameters
+ + + + + +
wsiWebsocket instance (available from user callback)
bufThe data to send. For data being sent on a websocket connection (ie, not default http), this buffer MUST have LWS_PRE bytes valid BEFORE the pointer. This is so the protocol header data can be added in-situ.
lenCount of the data bytes in the payload starting from buf
protocolUse LWS_WRITE_HTTP to reply to an http connection, and one of LWS_WRITE_BINARY or LWS_WRITE_TEXT to send appropriate data on a websockets connection. Remember to allow the extra bytes before and after buf if LWS_WRITE_BINARY or LWS_WRITE_TEXT are used.
+
+
+

This function provides the way to issue data back to the client for both http and websocket protocols.

+

IMPORTANT NOTICE!

+

When sending with websocket protocol

+

LWS_WRITE_TEXT, LWS_WRITE_BINARY, LWS_WRITE_CONTINUATION, LWS_WRITE_PING, LWS_WRITE_PONG

+

the send buffer has to have LWS_PRE bytes valid BEFORE the buffer pointer you pass to lws_write().

+

This allows us to add protocol info before and after the data, and send as one packet on the network without payload copying, for maximum efficiency.

+

So for example you need this kind of code to use lws_write with a 128-byte payload

+

char buf[LWS_PRE + 128];

+

// fill your part of the buffer... for example here it's all zeros memset(&buf[LWS_PRE], 0, 128);

+

lws_write(wsi, &buf[LWS_PRE], 128, LWS_WRITE_TEXT);

+

When sending HTTP, with

+

LWS_WRITE_HTTP, LWS_WRITE_HTTP_HEADERS LWS_WRITE_HTTP_FINAL

+

there is no protocol data prepended, and don't need to take care about the LWS_PRE bytes valid before the buffer pointer.

+

LWS_PRE is at least the frame nonce + 2 header + 8 length LWS_SEND_BUFFER_POST_PADDING is deprecated, it's now 0 and can be left off. The example apps no longer use it.

+

Pad LWS_PRE to the CPU word size, so that word references to the address immediately after the padding won't cause an unaligned access error. Sometimes for performance reasons the recommended padding is even larger than sizeof(void *).

 In the case of sending using websocket protocol, be sure to allocate
+ valid storage before and after buf as explained above.  This scheme
+ allows maximum efficiency of sending data and protocol in a single
+ packet while not burdening the user code with any protocol knowledge.
+
+ Return may be -1 for a fatal error needing connection close, or a
+ positive number reflecting the amount of bytes actually sent.  This
+ can be less than the requested number of bytes due to OS memory
+ pressure at any given time.
+
+
+
+
+ + + + diff --git a/doc/html/group__sending-data.js b/doc/html/group__sending-data.js new file mode 100644 index 00000000..2fa2b625 --- /dev/null +++ b/doc/html/group__sending-data.js @@ -0,0 +1,13 @@ +var group__sending_data = +[ + [ "lws_write_protocol", "group__sending-data.html#ga98b099cf8c1c7e38ad78501f270e193d", [ + [ "LWS_WRITE_TEXT", "group__sending-data.html#gga98b099cf8c1c7e38ad78501f270e193da80e8f169fda236c56bfb795ed62903db", null ], + [ "LWS_WRITE_BINARY", "group__sending-data.html#gga98b099cf8c1c7e38ad78501f270e193daf6486c0dba50c44198100717721d9ab2", null ], + [ "LWS_WRITE_CONTINUATION", "group__sending-data.html#gga98b099cf8c1c7e38ad78501f270e193da10047eb05b5e1c298151dc47a5b44826", null ], + [ "LWS_WRITE_HTTP", "group__sending-data.html#gga98b099cf8c1c7e38ad78501f270e193dabb6705e1d1327cdda5025be28f07712e", null ], + [ "LWS_WRITE_HTTP_HEADERS", "group__sending-data.html#gga98b099cf8c1c7e38ad78501f270e193dafe5a38e940ce56708ac814627e9c0917", null ], + [ "LWS_WRITE_NO_FIN", "group__sending-data.html#gga98b099cf8c1c7e38ad78501f270e193da115440f272a5d55518adfc8099acfee3", null ], + [ "LWS_WRITE_CLIENT_IGNORE_XOR_MASK", "group__sending-data.html#gga98b099cf8c1c7e38ad78501f270e193da220d8e8652d9b97fb66e476e2a60ffce", null ] + ] ], + [ "lws_write", "group__sending-data.html#gafd5fdd285a0e25ba7e3e1051deec1001", null ] +]; \ No newline at end of file diff --git a/doc/html/group__service.html b/doc/html/group__service.html new file mode 100644 index 00000000..5b90a85e --- /dev/null +++ b/doc/html/group__service.html @@ -0,0 +1,328 @@ + + + + + + +libwebsockets: Built-in service loop entry + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Built-in service loop entry
+
+
+ + + + + + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN int lws_service (struct lws_context *context, int timeout_ms)
 
LWS_VISIBLE LWS_EXTERN int lws_service_tsi (struct lws_context *context, int timeout_ms, int tsi)
 
LWS_VISIBLE LWS_EXTERN void lws_cancel_service_pt (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN void lws_cancel_service (struct lws_context *context)
 
LWS_VISIBLE LWS_EXTERN int lws_service_fd (struct lws_context *context, struct lws_pollfd *pollfd)
 
LWS_VISIBLE LWS_EXTERN int lws_service_fd_tsi (struct lws_context *context, struct lws_pollfd *pollfd, int tsi)
 
+

Detailed Description

+

Built-in service loop entry

+

If you're not using libev / libuv, these apis are needed to enter the poll() wait in lws and service any connections with pending events.

+

Function Documentation

+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lws_cancel_service (struct lws_context * context)
+
+ +

#include <lib/libwebsockets.h>

+

lws_cancel_service() - Cancel wait for new pending socket activity

Parameters
+ + +
contextWebsocket context
 This function let a call to lws_service() waiting for a timeout
+ immediately return.
+
+ What it basically does is provide a fake event that will be swallowed,
+ so the wait in poll() is ended.  That's useful because poll() doesn't
+ attend to changes in POLLIN/OUT/ERR until it re-enters the wait.
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lws_cancel_service_pt (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_cancel_service_pt() - Cancel servicing of pending socket activity on one thread

Parameters
+ + +
wsiCancel service on the thread this wsi is serviced by
 This function lets a call to lws_service() waiting for a timeout
+ immediately return.
+
+ It works by creating a phony event and then swallowing it silently.
+
+ The reason it may be needed is when waiting in poll(), changes to
+ the event masks are ignored by the OS until poll() is reentered.  This
+ lets you halt the poll() wait and make the reentry happen immediately
+ instead of having the wait out the rest of the poll timeout.
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_service (struct lws_context * context,
int timeout_ms 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_service() - Service any pending websocket activity

Parameters
+ + + +
contextWebsocket context
timeout_msTimeout for poll; 0 means return immediately if nothing needed service otherwise block and service immediately, returning after the timeout if nothing needed service.
+
+
+

This function deals with any pending websocket traffic, for three kinds of event. It handles these events on both server and client types of connection the same.

+

1) Accept new connections to our context's server

+

2) Call the receive callback for incoming frame data received by server or client connections.

+

You need to call this service function periodically to all the above functions to happen; if your application is single-threaded you can just call it in your main event loop.

+

Alternatively you can fork a new process that asynchronously handles calling this service in a loop. In that case you are happy if this call blocks your thread until it needs to take care of something and would call it with a large nonzero timeout. Your loop then takes no CPU while there is nothing happening.

+

If you are calling it in a single-threaded app, you don't want it to wait around blocking other things in your loop from happening, so you would call it with a timeout_ms of 0, so it returns immediately if nothing is pending, or as soon as it services whatever was pending.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_service_fd (struct lws_context * context,
struct lws_pollfdpollfd 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_service_fd() - Service polled socket with something waiting

Parameters
+ + + +
contextWebsocket context
pollfdThe pollfd entry describing the socket fd and which events happened.
+
+
+

This function takes a pollfd that has POLLIN or POLLOUT activity and services it according to the state of the associated struct lws.

+

The one call deals with all "service" that might happen on a socket including listen accepts, http files as well as websocket protocol.

+

If a pollfd says it has something, you can just pass it to lws_service_fd() whether it is a socket handled by lws or not. If it sees it is a lws socket, the traffic will be handled and pollfd->revents will be zeroed now.

+

If the socket is foreign to lws, it leaves revents alone. So you can see if you should service yourself by checking the pollfd revents after letting lws try to service it.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_service_fd_tsi (struct lws_context * context,
struct lws_pollfdpollfd,
int tsi 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_service_fd_tsi() - Service polled socket in specific service thread

Parameters
+ + + + +
contextWebsocket context
pollfdThe pollfd entry describing the socket fd and which events happened.
tsithread service index
+
+
+

Same as lws_service_fd() but used with multiple service threads

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_service_tsi (struct lws_context * context,
int timeout_ms,
int tsi 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_service() - Service any pending websocket activity

+
Parameters
+ + + +
contextWebsocket context
timeout_msTimeout for poll; 0 means return immediately if nothing needed service otherwise block and service immediately, returning after the timeout if nothing needed service.
+
+
+

Same as lws_service(), but for a specific thread service index. Only needed if you are spawning multiple service threads.

+ +
+
+
+
+ + + + diff --git a/doc/html/group__service.js b/doc/html/group__service.js new file mode 100644 index 00000000..5a815ce9 --- /dev/null +++ b/doc/html/group__service.js @@ -0,0 +1,9 @@ +var group__service = +[ + [ "lws_cancel_service", "group__service.html#ga53e3d0801dfda7960a7249dd559e68a2", null ], + [ "lws_cancel_service_pt", "group__service.html#ga29c246707997ab7a466aa709aecd2d7b", null ], + [ "lws_service", "group__service.html#gaf95bd0c663d6516a0c80047d9b1167a8", null ], + [ "lws_service_fd", "group__service.html#gad82efa5466d14a9f05aa06416375b28d", null ], + [ "lws_service_fd_tsi", "group__service.html#gaebf426eda371ba23642fc11d8e0ace6b", null ], + [ "lws_service_tsi", "group__service.html#ga9b3cc4473fd8848e5bbee7f310712939", null ] +]; \ No newline at end of file diff --git a/doc/html/group__sha.html b/doc/html/group__sha.html new file mode 100644 index 00000000..33b0a154 --- /dev/null +++ b/doc/html/group__sha.html @@ -0,0 +1,234 @@ + + + + + + +libwebsockets: SHA and B64 helpers + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
SHA and B64 helpers
+
+
+ + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN unsigned char * lws_SHA1 (const unsigned char *d, size_t n, unsigned char *md)
 
LWS_VISIBLE LWS_EXTERN int lws_b64_encode_string (const char *in, int in_len, char *out, int out_size)
 
LWS_VISIBLE LWS_EXTERN int lws_b64_decode_string (const char *in, char *out, int out_size)
 
+

Detailed Description

+

SHA and B64 helpers

+

These provide SHA-1 and B64 helper apis

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_b64_decode_string (const char * in,
char * out,
int out_size 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_b64_decode_string(): decode a string from base 64

+
Parameters
+ + + + +
inincoming buffer
outresult buffer
out_sizelength of result buffer
+
+
+

Decodes a string using b64

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_b64_encode_string (const char * in,
int in_len,
char * out,
int out_size 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_b64_encode_string(): encode a string into base 64

+
Parameters
+ + + + + +
inincoming buffer
in_lenlength of incoming buffer
outresult buffer
out_sizelength of result buffer
+
+
+

Encodes a string using b64

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN unsigned char* lws_SHA1 (const unsigned char * d,
size_t n,
unsigned char * md 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_SHA1(): make a SHA-1 digest of a buffer

+
Parameters
+ + + + +
dincoming buffer
nlength of incoming buffer
mdbuffer for message digest (must be >= 20 bytes)
+
+
+

Reduces any size buffer into a 20-byte SHA-1 hash.

+ +
+
+
+
+ + + + diff --git a/doc/html/group__sha.js b/doc/html/group__sha.js new file mode 100644 index 00000000..4d76d270 --- /dev/null +++ b/doc/html/group__sha.js @@ -0,0 +1,6 @@ +var group__sha = +[ + [ "lws_b64_decode_string", "group__sha.html#ga66316e6a5a0644a09d5a10e919dfdd8d", null ], + [ "lws_b64_encode_string", "group__sha.html#gaf39765e4a3b413efb65e4698b2ec3575", null ], + [ "lws_SHA1", "group__sha.html#ga7b09ab74646266f0b555103b3bb8dfe5", null ] +]; \ No newline at end of file diff --git a/doc/html/group__smtp.html b/doc/html/group__smtp.html new file mode 100644 index 00000000..2592f3e2 --- /dev/null +++ b/doc/html/group__smtp.html @@ -0,0 +1,280 @@ + + + + + + +libwebsockets: Smtp + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+ + + + +

+Data Structures

struct  lws_email
 
+ + + +

+Enumerations

enum  lwsgs_smtp_states {
+  LGSSMTP_IDLE, +LGSSMTP_CONNECTING, +LGSSMTP_CONNECTED, +LGSSMTP_SENT_HELO, +
+  LGSSMTP_SENT_FROM, +LGSSMTP_SENT_TO, +LGSSMTP_SENT_DATA, +LGSSMTP_SENT_BODY, +
+  LGSSMTP_SENT_QUIT +
+ }
 
+ + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN int lws_email_init (struct lws_email *email, uv_loop_t *loop, int max_content)
 
LWS_VISIBLE LWS_EXTERN void lws_email_check (struct lws_email *email)
 
LWS_VISIBLE LWS_EXTERN void lws_email_destroy (struct lws_email *email)
 
+

Detailed Description

+

SMTP related functions

+

These apis let you communicate with a local SMTP server to send email from lws. It handles all the SMTP sequencing and protocol actions.

+

Your system should have postfix, sendmail or another MTA listening on port 25 and able to send email using the "mail" commandline app. Usually distro MTAs are configured for this by default.

+

It runs via its own libuv events if initialized (which requires giving it a libuv loop to attach to).

+

It operates using three callbacks, on_next() queries if there is a new email to send, on_get_body() asks for the body of the email, and on_sent() is called after the email is successfully sent.

+

To use it

+
    +
  • create an lws_email struct
  • +
  • initialize data, loop, the email_* strings, max_content_size and the callbacks
  • +
  • call lws_email_init()
  • +
+

When you have at least one email to send, call lws_email_check() to schedule starting to send it.

+

Enumeration Type Documentation

+ +
+
+ + + + +
enum lwsgs_smtp_states
+
+ +

#include <lib/libwebsockets.h>

+

enum lwsgs_smtp_states - where we are in SMTP protocol sequence

+ + + + + + + + + + +
Enumerator
LGSSMTP_IDLE  +

awaiting new email

+
LGSSMTP_CONNECTING  +

opening tcp connection to MTA

+
LGSSMTP_CONNECTED  +

tcp connection to MTA is connected

+
LGSSMTP_SENT_HELO  +

sent the HELO

+
LGSSMTP_SENT_FROM  +

sent FROM

+
LGSSMTP_SENT_TO  +

sent TO

+
LGSSMTP_SENT_DATA  +

sent DATA request

+
LGSSMTP_SENT_BODY  +

sent the email body

+
LGSSMTP_SENT_QUIT  +

sent the session quit

+
+
3815  {
3816  LGSSMTP_IDLE,
3821  LGSSMTP_SENT_TO,
3825 };
Definition: libwebsockets.h:3818
+
Definition: libwebsockets.h:3823
+
Definition: libwebsockets.h:3816
+
Definition: libwebsockets.h:3817
+
Definition: libwebsockets.h:3821
+
Definition: libwebsockets.h:3820
+
Definition: libwebsockets.h:3824
+
Definition: libwebsockets.h:3819
+
Definition: libwebsockets.h:3822
+
+
+
+

Function Documentation

+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lws_email_check (struct lws_emailemail)
+
+ +

#include <lib/libwebsockets.h>

+

lws_email_check() - Request check for new email

+
Parameters
+ + +
emailstruct lws_email context to check
+
+
+

Schedules a check for new emails in 1s... call this when you have queued an email for send.

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lws_email_destroy (struct lws_emailemail)
+
+ +

#include <lib/libwebsockets.h>

+

lws_email_destroy() - stop using the struct lws_email

+
Parameters
+ + +
emailthe struct lws_email context
+
+
+

Stop sending email using email and free allocations

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_email_init (struct lws_emailemail,
uv_loop_t * loop,
int max_content 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_email_init() - Initialize a struct lws_email

+
Parameters
+ + + + +
emailstruct lws_email to init
looplibuv loop to use
max_contentmax email content size
+
+
+

Prepares a struct lws_email for use ending SMTP

+ +
+
+
+
+ + + + diff --git a/doc/html/group__smtp.js b/doc/html/group__smtp.js new file mode 100644 index 00000000..fcd3e39b --- /dev/null +++ b/doc/html/group__smtp.js @@ -0,0 +1,36 @@ +var group__smtp = +[ + [ "lws_email", "structlws__email.html", [ + [ "content", "structlws__email.html#a6fff03c5a5d369a2aa3cab0c897b1bed", null ], + [ "data", "structlws__email.html#add1341456045382c183f4c763bdea6bc", null ], + [ "email_buf", "structlws__email.html#a8f34ec0643a817be67ef4276aeb7fb82", null ], + [ "email_client", "structlws__email.html#a01f31934166dc6d01e8a375012f8ad1e", null ], + [ "email_connect_req", "structlws__email.html#a5f53d4c5a1e34b0dcaa8787e2eabb1b3", null ], + [ "email_connect_started", "structlws__email.html#a9747ca85597788c2d118d287df47b7c1", null ], + [ "email_from", "structlws__email.html#af7f0ae934347d81071f63a963301f9e2", null ], + [ "email_helo", "structlws__email.html#a939e5d7ee0339a16de73bde71ab4d4d9", null ], + [ "email_smtp_ip", "structlws__email.html#a472ae23fc9fca6599e5c512bc21458d2", null ], + [ "email_to", "structlws__email.html#a6453a8b92b3de6d2c2101af3edce685e", null ], + [ "estate", "structlws__email.html#ac6115d3cbef2e8bac62cc00895bf5fd3", null ], + [ "loop", "structlws__email.html#ab5fbf121195a8e67509c78a42cfbe168", null ], + [ "max_content_size", "structlws__email.html#a7bbc1964889c984b3da723c86a210e05", null ], + [ "on_get_body", "structlws__email.html#a2aff78c8e04db243052aa91b4d87e987", null ], + [ "on_next", "structlws__email.html#ad8dc60353ee246d84dd59ec0591e9719", null ], + [ "on_sent", "structlws__email.html#a39ef6263d58eb40cca417c8697b227d8", null ], + [ "timeout_email", "structlws__email.html#a77723e2f2b940b1c879ef5e1cd88c2be", null ] + ] ], + [ "lwsgs_smtp_states", "group__smtp.html#ga116be79bf44f9dc2a97f46e051fe4dc0", [ + [ "LGSSMTP_IDLE", "group__smtp.html#gga116be79bf44f9dc2a97f46e051fe4dc0a29e5b0ecf75375b5a643faa3d6222b7c", null ], + [ "LGSSMTP_CONNECTING", "group__smtp.html#gga116be79bf44f9dc2a97f46e051fe4dc0ab89442b7a3ca2b94c3cdcf33756eb933", null ], + [ "LGSSMTP_CONNECTED", "group__smtp.html#gga116be79bf44f9dc2a97f46e051fe4dc0ab61778f70ecac007b334bb14942eb41d", null ], + [ "LGSSMTP_SENT_HELO", "group__smtp.html#gga116be79bf44f9dc2a97f46e051fe4dc0a1dfec948a864205cec875f63cbe0d4ad", null ], + [ "LGSSMTP_SENT_FROM", "group__smtp.html#gga116be79bf44f9dc2a97f46e051fe4dc0a929bb4623ff3f585108aba2a1b047fab", null ], + [ "LGSSMTP_SENT_TO", "group__smtp.html#gga116be79bf44f9dc2a97f46e051fe4dc0aae20a0cb95b97a70f6b45d0ed2d5be83", null ], + [ "LGSSMTP_SENT_DATA", "group__smtp.html#gga116be79bf44f9dc2a97f46e051fe4dc0a85e3c452950c09a79086bff4b9be5c14", null ], + [ "LGSSMTP_SENT_BODY", "group__smtp.html#gga116be79bf44f9dc2a97f46e051fe4dc0a38fba41f28d754e38079b31418a86a69", null ], + [ "LGSSMTP_SENT_QUIT", "group__smtp.html#gga116be79bf44f9dc2a97f46e051fe4dc0a2c2ed16ffc572326e3040684084b21d5", null ] + ] ], + [ "lws_email_check", "group__smtp.html#ga5e535e346d92a9daf00be33abf79d4eb", null ], + [ "lws_email_destroy", "group__smtp.html#ga25298a5afc1074e13b2d5711a86432b2", null ], + [ "lws_email_init", "group__smtp.html#ga77fc9b56a1bb39484844981ec375fc29", null ] +]; \ No newline at end of file diff --git a/doc/html/group__sock-adopt.html b/doc/html/group__sock-adopt.html new file mode 100644 index 00000000..5981a9ef --- /dev/null +++ b/doc/html/group__sock-adopt.html @@ -0,0 +1,190 @@ + + + + + + +libwebsockets: Socket adoption helpers + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Socket adoption helpers
+
+
+ + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN struct lws * lws_adopt_socket (struct lws_context *context, lws_sockfd_type accept_fd)
 
LWS_VISIBLE LWS_EXTERN struct lws * lws_adopt_socket_readbuf (struct lws_context *context, lws_sockfd_type accept_fd, const char *readbuf, size_t len)
 
+

Detailed Description

+

Socket adoption helpers

+

When integrating with an external app with its own event loop, these can be used to accept connections from someone else's listening socket.

+

When using lws own event loop, these are not needed.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws* lws_adopt_socket (struct lws_context * context,
lws_sockfd_type accept_fd 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_adopt_socket() - adopt foreign socket as if listen socket accepted it

Parameters
+ + + +
contextlws context
accept_fdfd of already-accepted socket to adopt
+
+
+

Either returns new wsi bound to accept_fd, or closes accept_fd and returns NULL, having cleaned up any new wsi pieces.

+

LWS adopts the socket in http serving mode, it's ready to accept an upgrade to ws or just serve http.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN struct lws* lws_adopt_socket_readbuf (struct lws_context * context,
lws_sockfd_type accept_fd,
const char * readbuf,
size_t len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_adopt_socket_readbuf() - adopt foreign socket and first rx as if listen socket accepted it

Parameters
+ + + + + + +
contextlws context
accept_fdfd of already-accepted socket to adopt
readbufNULL or pointer to data that must be drained before reading from accept_fd
lenThe length of the data held at
readbufEither returns new wsi bound to accept_fd, or closes accept_fd and returns NULL, having cleaned up any new wsi pieces.
+
+
+

LWS adopts the socket in http serving mode, it's ready to accept an upgrade to ws or just serve http.

+

If your external code did not already read from the socket, you can use lws_adopt_socket() instead.

+

This api is guaranteed to use the data at

Parameters
+ + +
readbuffirst, before reading from the socket.
+
+
+

readbuf is limited to the size of the ah rx buf, currently 2048 bytes.

+ +
+
+
+
+ + + + diff --git a/doc/html/group__sock-adopt.js b/doc/html/group__sock-adopt.js new file mode 100644 index 00000000..a5d3eac3 --- /dev/null +++ b/doc/html/group__sock-adopt.js @@ -0,0 +1,5 @@ +var group__sock_adopt = +[ + [ "lws_adopt_socket", "group__sock-adopt.html#gabe71b7462afb21c767bdc67334f305af", null ], + [ "lws_adopt_socket_readbuf", "group__sock-adopt.html#gab2d045df0f81afe00891aaed312d552b", null ] +]; \ No newline at end of file diff --git a/doc/html/group__timeout.html b/doc/html/group__timeout.html new file mode 100644 index 00000000..964ecbd1 --- /dev/null +++ b/doc/html/group__timeout.html @@ -0,0 +1,161 @@ + + + + + + +libwebsockets: Connection timeouts + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Connection timeouts
+
+
+ + + + +

+Enumerations

enum  pending_timeout {
+  NO_PENDING_TIMEOUT = 0, +PENDING_TIMEOUT_AWAITING_PROXY_RESPONSE = 1, +PENDING_TIMEOUT_AWAITING_CONNECT_RESPONSE = 2, +PENDING_TIMEOUT_ESTABLISH_WITH_SERVER = 3, +
+  PENDING_TIMEOUT_AWAITING_SERVER_RESPONSE = 4, +PENDING_TIMEOUT_AWAITING_PING = 5, +PENDING_TIMEOUT_CLOSE_ACK = 6, +PENDING_TIMEOUT_AWAITING_EXTENSION_CONNECT_RESPONSE = 7, +
+  PENDING_TIMEOUT_SENT_CLIENT_HANDSHAKE = 8, +PENDING_TIMEOUT_SSL_ACCEPT = 9, +PENDING_TIMEOUT_HTTP_CONTENT = 10, +PENDING_TIMEOUT_AWAITING_CLIENT_HS_SEND = 11, +
+  PENDING_FLUSH_STORED_SEND_BEFORE_CLOSE = 12, +PENDING_TIMEOUT_SHUTDOWN_FLUSH = 13, +PENDING_TIMEOUT_CGI = 14, +PENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE = 15 +
+ }
 
+ + + +

+Functions

LWS_VISIBLE LWS_EXTERN void lws_set_timeout (struct lws *wsi, enum pending_timeout reason, int secs)
 
+

Detailed Description

+

APIs related to setting connection timeouts

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lws_set_timeout (struct lws * wsi,
enum pending_timeout reason,
int secs 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_set_timeout() - marks the wsi as subject to a timeout

+

You will not need this unless you are doing something special

+
Parameters
+ + + + +
wsiWebsocket connection instance
reasontimeout reason
secshow many seconds
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__timeout.js b/doc/html/group__timeout.js new file mode 100644 index 00000000..48489a62 --- /dev/null +++ b/doc/html/group__timeout.js @@ -0,0 +1,4 @@ +var group__timeout = +[ + [ "lws_set_timeout", "group__timeout.html#gaced9f9237f6172fed9f730a2af51345a", null ] +]; \ No newline at end of file diff --git a/doc/html/group__urlendec.html b/doc/html/group__urlendec.html new file mode 100644 index 00000000..b8eb1262 --- /dev/null +++ b/doc/html/group__urlendec.html @@ -0,0 +1,182 @@ + + + + + + +libwebsockets: Urlencode and Urldecode + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Urlencode and Urldecode
+
+
+ + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN const char * lws_urlencode (char *escaped, const char *string, int len)
 
LWS_VISIBLE LWS_EXTERN int lws_urldecode (char *string, const char *escaped, int len)
 
+

Detailed Description

+

HTML chunked Substitution

+

APIs for receiving chunks of text, replacing a set of variable names via a callback, and then prepending and appending HTML chunked encoding headers.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_urldecode (char * string,
const char * escaped,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_urldecode() - like strncpy but with urldecoding

+
Parameters
+ + + + +
stringoutput buffer
escapedinput buffer ('\0' terminated)
lenoutput buffer max length
+
+
+

This is only useful for '\0' terminated strings

+

Since urldecoding only shrinks the output string, it is possible to do it in-place, ie, string == escaped

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN const char* lws_urlencode (char * escaped,
const char * string,
int len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_urlencode() - like strncpy but with urlencoding

+
Parameters
+ + + + +
escapedoutput buffer
stringinput buffer ('/0' terminated)
lenoutput buffer max length
+
+
+

Because urlencoding expands the output string, it's not possible to do it in-place, ie, with escaped == string

+ +
+
+
+
+ + + + diff --git a/doc/html/group__urlendec.js b/doc/html/group__urlendec.js new file mode 100644 index 00000000..671ac7c5 --- /dev/null +++ b/doc/html/group__urlendec.js @@ -0,0 +1,5 @@ +var group__urlendec = +[ + [ "lws_urldecode", "group__urlendec.html#gaa373a9c16acdd96c395af61ab915ece3", null ], + [ "lws_urlencode", "group__urlendec.html#gabc2888476e50e001c875c1a8abf455b7", null ] +]; \ No newline at end of file diff --git a/doc/html/group__usercb.html b/doc/html/group__usercb.html new file mode 100644 index 00000000..76a46ffd --- /dev/null +++ b/doc/html/group__usercb.html @@ -0,0 +1,392 @@ + + + + + + +libwebsockets: User Callback + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
User Callback
+
+
+ + + + +

+Typedefs

typedef int lws_callback_function(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len)
 
+ + + +

+Enumerations

enum  lws_callback_reasons {
+  LWS_CALLBACK_ESTABLISHED = 0, +LWS_CALLBACK_CLIENT_CONNECTION_ERROR = 1, +LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH = 2, +LWS_CALLBACK_CLIENT_ESTABLISHED = 3, +
+  LWS_CALLBACK_CLOSED = 4, +LWS_CALLBACK_CLOSED_HTTP = 5, +LWS_CALLBACK_RECEIVE = 6, +LWS_CALLBACK_RECEIVE_PONG = 7, +
+  LWS_CALLBACK_CLIENT_RECEIVE = 8, +LWS_CALLBACK_CLIENT_RECEIVE_PONG = 9, +LWS_CALLBACK_CLIENT_WRITEABLE = 10, +LWS_CALLBACK_SERVER_WRITEABLE = 11, +
+  LWS_CALLBACK_HTTP = 12, +LWS_CALLBACK_HTTP_BODY = 13, +LWS_CALLBACK_HTTP_BODY_COMPLETION = 14, +LWS_CALLBACK_HTTP_FILE_COMPLETION = 15, +
+  LWS_CALLBACK_HTTP_WRITEABLE = 16, +LWS_CALLBACK_FILTER_NETWORK_CONNECTION = 17, +LWS_CALLBACK_FILTER_HTTP_CONNECTION = 18, +LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED = 19, +
+  LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION = 20, +LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS = 21, +LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS = 22, +LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION = 23, +
+  LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER = 24, +LWS_CALLBACK_CONFIRM_EXTENSION_OKAY = 25, +LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED = 26, +LWS_CALLBACK_PROTOCOL_INIT = 27, +
+  LWS_CALLBACK_PROTOCOL_DESTROY = 28, +LWS_CALLBACK_WSI_CREATE = 29, +LWS_CALLBACK_WSI_DESTROY = 30, +LWS_CALLBACK_GET_THREAD_ID = 31, +
+  LWS_CALLBACK_ADD_POLL_FD = 32, +LWS_CALLBACK_DEL_POLL_FD = 33, +LWS_CALLBACK_CHANGE_MODE_POLL_FD = 34, +LWS_CALLBACK_LOCK_POLL = 35, +
+  LWS_CALLBACK_UNLOCK_POLL = 36, +LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY = 37, +LWS_CALLBACK_WS_PEER_INITIATED_CLOSE = 38, +LWS_CALLBACK_WS_EXT_DEFAULTS = 39, +
+  LWS_CALLBACK_CGI = 40, +LWS_CALLBACK_CGI_TERMINATED = 41, +LWS_CALLBACK_CGI_STDIN_DATA = 42, +LWS_CALLBACK_CGI_STDIN_COMPLETED = 43, +
+  LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP = 44, +LWS_CALLBACK_CLOSED_CLIENT_HTTP = 45, +LWS_CALLBACK_RECEIVE_CLIENT_HTTP = 46, +LWS_CALLBACK_COMPLETED_CLIENT_HTTP = 47, +
+  LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ = 48, +LWS_CALLBACK_HTTP_BIND_PROTOCOL = 49, +LWS_CALLBACK_HTTP_DROP_PROTOCOL = 50, +LWS_CALLBACK_CHECK_ACCESS_RIGHTS = 51, +
+  LWS_CALLBACK_PROCESS_HTML = 52, +LWS_CALLBACK_ADD_HEADERS = 53, +LWS_CALLBACK_SESSION_INFO = 54, +LWS_CALLBACK_GS_EVENT = 55, +
+  LWS_CALLBACK_USER = 1000 +
+ }
 
+

Detailed Description

+

User protocol callback

+

The protocol callback is the primary way lws interacts with user code. For one of a list of a few dozen reasons the callback gets called at some event to be handled.

+

All of the events can be ignored, returning 0 is taken as "OK" and returning nonzero in most cases indicates that the connection should be closed.

+

Typedef Documentation

+ +
+
+ + + + +
typedef int lws_callback_function(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len)
+
+ +

#include <lib/libwebsockets.h>

+

typedef lws_callback_function() - User server actions

Parameters
+ + + + + + +
wsiOpaque websocket instance pointer
reasonThe reason for the call
userPointer to per-session user data allocated by library
inPointer used for some callback reasons
lenLength set for some callback reasons
 This callback is the way the user controls what is served.  All the
+ protocol detail is hidden and handled by the library.
+
+ For each connection / session there is user data allocated that is
+ pointed to by "user".  You set the size of this user data area when
+ the library is initialized with lws_create_server.
+
+
+ +
+
+

Enumeration Type Documentation

+ +
+
+ + + + +
enum lws_callback_reasons
+
+ +

#include <lib/libwebsockets.h>

+

enum lws_callback_reasons - reason you're getting a protocol callback

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enumerator
LWS_CALLBACK_ESTABLISHED  +

(VH) after the server completes a handshake with an incoming client. If you built the library with ssl support, in is a pointer to the ssl struct associated with the connection or NULL.

+
LWS_CALLBACK_CLIENT_CONNECTION_ERROR  +

the request client connection has been unable to complete a handshake with the remote server. If in is non-NULL, you can find an error string of length len where it points to.

+
LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH  +

this is the last chance for the client user code to examine the http headers and decide to reject the connection. If the content in the headers is interesting to the client (url, etc) it needs to copy it out at this point since it will be destroyed before the CLIENT_ESTABLISHED call

+
LWS_CALLBACK_CLIENT_ESTABLISHED  +

after your client connection completed a handshake with the remote server

+
LWS_CALLBACK_CLOSED  +

when the websocket session ends

+
LWS_CALLBACK_CLOSED_HTTP  +

when a HTTP (non-websocket) session ends

+
LWS_CALLBACK_RECEIVE  +

data has appeared for this server endpoint from a remote client, it can be found at *in and is len bytes long

+
LWS_CALLBACK_RECEIVE_PONG  +

servers receive PONG packets with this callback reason

+
LWS_CALLBACK_CLIENT_RECEIVE  +

data has appeared from the server for the client connection, it can be found at *in and is len bytes long

+
LWS_CALLBACK_CLIENT_RECEIVE_PONG  +

clients receive PONG packets with this callback reason

+
LWS_CALLBACK_CLIENT_WRITEABLE  +

If you call lws_callback_on_writable() on a connection, you will get one of these callbacks coming when the connection socket is able to accept another write packet without blocking. If it already was able to take another packet without blocking, you'll get this callback at the next call to the service loop function. Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE and servers get LWS_CALLBACK_SERVER_WRITEABLE.

+
LWS_CALLBACK_SERVER_WRITEABLE  +

See LWS_CALLBACK_CLIENT_WRITEABLE

+
LWS_CALLBACK_HTTP  +

an http request has come from a client that is not asking to upgrade the connection to a websocket one. This is a chance to serve http content, for example, to send a script to the client which will then open the websockets connection. in points to the URI path requested and lws_serve_http_file() makes it very simple to send back a file to the client. Normally after sending the file you are done with the http connection, since the rest of the activity will come by websockets from the script that was delivered by http, so you will want to return 1; to close and free up the connection.

+
LWS_CALLBACK_HTTP_BODY  +

the next len bytes data from the http request body HTTP connection is now available in in.

+
LWS_CALLBACK_HTTP_BODY_COMPLETION  +

the expected amount of http request body has been delivered

+
LWS_CALLBACK_HTTP_FILE_COMPLETION  +

a file requested to be sent down http link has completed.

+
LWS_CALLBACK_HTTP_WRITEABLE  +

you can write more down the http protocol link now.

+
LWS_CALLBACK_FILTER_NETWORK_CONNECTION  +

called when a client connects to the server at network level; the connection is accepted but then passed to this callback to decide whether to hang up immediately or not, based on the client IP. in contains the connection socket's descriptor. Since the client connection information is not available yet, wsi still pointing to the main server socket. Return non-zero to terminate the connection before sending or receiving anything. Because this happens immediately after the network connection from the client, there's no websocket protocol selected yet so this callback is issued only to protocol 0.

+
LWS_CALLBACK_FILTER_HTTP_CONNECTION  +

called when the request has been received and parsed from the client, but the response is not sent yet. Return non-zero to disallow the connection. user is a pointer to the connection user space allocation, in is the URI, eg, "/" In your handler you can use the public APIs lws_hdr_total_length() / lws_hdr_copy() to access all of the headers using the header enums lws_token_indexes from libwebsockets.h to check for and read the supported header presence and content before deciding to allow the http connection to proceed or to kill the connection.

+
LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED  +

A new client just had been connected, accepted, and instantiated into the pool. This callback allows setting any relevant property to it. Because this happens immediately after the instantiation of a new client, there's no websocket protocol selected yet so this callback is issued only to protocol 0. Only wsi is defined, pointing to the new client, and the return value is ignored.

+
LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION  +

called when the handshake has been received and parsed from the client, but the response is not sent yet. Return non-zero to disallow the connection. user is a pointer to the connection user space allocation, in is the requested protocol name In your handler you can use the public APIs lws_hdr_total_length() / lws_hdr_copy() to access all of the headers using the header enums lws_token_indexes from libwebsockets.h to check for and read the supported header presence and content before deciding to allow the handshake to proceed or to kill the connection.

+
LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS  +

if configured for including OpenSSL support, this callback allows your user code to perform extra SSL_CTX_load_verify_locations() or similar calls to direct OpenSSL where to find certificates the client can use to confirm the remote server identity. user is the OpenSSL SSL_CTX*

+
LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS  +

if configured for including OpenSSL support, this callback allows your user code to load extra certifcates into the server which allow it to verify the validity of certificates returned by clients. user is the server's OpenSSL SSL_CTX*

+
LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION  +

if the libwebsockets vhost was created with the option LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this callback is generated during OpenSSL verification of the cert sent from the client. It is sent to protocol[0] callback as no protocol has been negotiated on the connection yet. Notice that the libwebsockets context and wsi are both NULL during this callback. See http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html to understand more detail about the OpenSSL callback that generates this libwebsockets callback and the meanings of the arguments passed. In this callback, user is the x509_ctx, in is the ssl pointer and len is preverify_ok Notice that this callback maintains libwebsocket return conventions, return 0 to mean the cert is OK or 1 to fail it. This also means that if you don't handle this callback then the default callback action of returning 0 allows the client certificates.

+
LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER  +

this callback happens when a client handshake is being compiled. user is NULL, in is a char **, it's pointing to a char * which holds the next location in the header buffer where you can add headers, and len is the remaining space in the header buffer, which is typically some hundreds of bytes. So, to add a canned cookie, your handler code might look similar to:

 char **p = (char **)in;
+
+ if (len < 100)
+    return 1;
+
+ *p += sprintf(*p, "Cookie: a=b\x0d\x0a");
+
+ return 0;
+

Notice if you add anything, you just have to take care about the CRLF on the line you added. Obviously this callback is optional, if you don't handle it everything is fine.

+

Notice the callback is coming to protocols[0] all the time, because there is no specific protocol negotiated yet.

+
LWS_CALLBACK_CONFIRM_EXTENSION_OKAY  +

When the server handshake code sees that it does support a requested extension, before accepting the extension by additing to the list sent back to the client it gives this callback just to check that it's okay to use that extension. It calls back to the requested protocol and with in being the extension name, len is 0 and user is valid. Note though at this time the ESTABLISHED callback hasn't happened yet so if you initialize user content there, user content during this callback might not be useful for anything. Notice this callback comes to protocols[0].

+
LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED  +

When a client connection is being prepared to start a handshake to a server, each supported extension is checked with protocols[0] callback with this reason, giving the user code a chance to suppress the claim to support that extension by returning non-zero. If unhandled, by default 0 will be returned and the extension support included in the header to the server. Notice this callback comes to protocols[0].

+
LWS_CALLBACK_PROTOCOL_INIT  +

One-time call per protocol, per-vhost using it, so it can do initial setup / allocations etc

+
LWS_CALLBACK_PROTOCOL_DESTROY  +

One-time call per protocol, per-vhost using it, indicating this protocol won't get used at all after this callback, the vhost is getting destroyed. Take the opportunity to deallocate everything that was allocated by the protocol.

+
LWS_CALLBACK_WSI_CREATE  +

outermost (earliest) wsi create notification to protocols[0]

+
LWS_CALLBACK_WSI_DESTROY  +

outermost (latest) wsi destroy notification to protocols[0]

+
LWS_CALLBACK_GET_THREAD_ID  +

lws can accept callback when writable requests from other threads, if you implement this callback and return an opaque current thread ID integer.

+
LWS_CALLBACK_ADD_POLL_FD  +

lws normally deals with its poll() or other event loop internally, but in the case you are integrating with another server you will need to have lws sockets share a polling array with the other server. This and the other POLL_FD related callbacks let you put your specialized poll array interface code in the callback for protocol 0, the first protocol you support, usually the HTTP protocol in the serving case. This callback happens when a socket needs to be added to the polling loop: in points to a struct lws_pollargs; the fd member of the struct is the file descriptor, and events contains the active events

+

If you are using the internal lws polling / event loop you can just ignore these callbacks.

+
LWS_CALLBACK_DEL_POLL_FD  +

This callback happens when a socket descriptor needs to be removed from an external polling array. in is again the struct lws_pollargs containing the fd member to be removed. If you are using the internal polling loop, you can just ignore it.

+
LWS_CALLBACK_CHANGE_MODE_POLL_FD  +

This callback happens when lws wants to modify the events for a connection. in is the struct lws_pollargs with the fd to change. The new event mask is in events member and the old mask is in the prev_events member. If you are using the internal polling loop, you can just ignore it.

+
LWS_CALLBACK_LOCK_POLL  +

These allow the external poll changes driven by lws to participate in an external thread locking scheme around the changes, so the whole thing is threadsafe. These are called around three activities in the library,

    +
  • inserting a new wsi in the wsi / fd table (len=1)
  • +
  • deleting a wsi from the wsi / fd table (len=1)
  • +
  • changing a wsi's POLLIN/OUT state (len=0) Locking and unlocking external synchronization objects when len == 1 allows external threads to be synchronized against wsi lifecycle changes if it acquires the same lock for the duration of wsi dereference from the other thread context.
  • +
+
LWS_CALLBACK_UNLOCK_POLL  +

See LWS_CALLBACK_LOCK_POLL, ignore if using lws internal poll

+
LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY  +

if configured for including OpenSSL support but no private key file has been specified (ssl_private_key_filepath is NULL), this is called to allow the user to set the private key directly via libopenssl and perform further operations if required; this might be useful in situations where the private key is not directly accessible by the OS, for example if it is stored on a smartcard. user is the server's OpenSSL SSL_CTX*

+
LWS_CALLBACK_WS_PEER_INITIATED_CLOSE  +

The peer has sent an unsolicited Close WS packet. in and len are the optional close code (first 2 bytes, network order) and the optional additional information which is not defined in the standard, and may be a string or non-human- readable data. If you return 0 lws will echo the close and then close the connection. If you return nonzero lws will just close the connection.

+
LWS_CALLBACK_USER  +

user code can use any including / above without fear of clashes

+
+
571  {
615  LWS_CALLBACK_HTTP = 12,
773  /* external poll() management support */
836  LWS_CALLBACK_WS_EXT_DEFAULTS = 39,
839  LWS_CALLBACK_CGI = 40,
841  LWS_CALLBACK_CGI_TERMINATED = 41,
843  LWS_CALLBACK_CGI_STDIN_DATA = 42,
845  LWS_CALLBACK_CGI_STDIN_COMPLETED = 43,
847  LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP = 44,
849  LWS_CALLBACK_CLOSED_CLIENT_HTTP = 45,
851  LWS_CALLBACK_RECEIVE_CLIENT_HTTP = 46,
853  LWS_CALLBACK_COMPLETED_CLIENT_HTTP = 47,
855  LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ = 48,
857  LWS_CALLBACK_HTTP_BIND_PROTOCOL = 49,
859  LWS_CALLBACK_HTTP_DROP_PROTOCOL = 50,
861  LWS_CALLBACK_CHECK_ACCESS_RIGHTS = 51,
863  LWS_CALLBACK_PROCESS_HTML = 52,
865  LWS_CALLBACK_ADD_HEADERS = 53,
867  LWS_CALLBACK_SESSION_INFO = 54,
870  LWS_CALLBACK_GS_EVENT = 55,
873  /****** add new things just above ---^ ******/
874 
875  LWS_CALLBACK_USER = 1000,
877 };
Definition: libwebsockets.h:638
+
Definition: libwebsockets.h:766
+ +
Definition: libwebsockets.h:764
+
Definition: libwebsockets.h:669
+
Definition: libwebsockets.h:615
+
Definition: libwebsockets.h:649
+
Definition: libwebsockets.h:790
+
Definition: libwebsockets.h:736
+
Definition: libwebsockets.h:629
+
Definition: libwebsockets.h:827
+ +
Definition: libwebsockets.h:816
+ +
Definition: libwebsockets.h:590
+
Definition: libwebsockets.h:768
+
Definition: libwebsockets.h:756
+
Definition: libwebsockets.h:587
+
Definition: libwebsockets.h:774
+
Definition: libwebsockets.h:580
+
Definition: libwebsockets.h:661
+
Definition: libwebsockets.h:759
+
Definition: libwebsockets.h:796
+
Definition: libwebsockets.h:636
+
Definition: libwebsockets.h:632
+
Definition: libwebsockets.h:572
+ +
Definition: libwebsockets.h:600
+
Definition: libwebsockets.h:634
+
Definition: libwebsockets.h:712
+
Definition: libwebsockets.h:598
+
Definition: libwebsockets.h:603
+ +
Definition: libwebsockets.h:576
+
Definition: libwebsockets.h:613
+
Definition: libwebsockets.h:875
+
Definition: libwebsockets.h:592
+
Definition: libwebsockets.h:594
+
Definition: libwebsockets.h:605
+
Definition: libwebsockets.h:804
+
+
+
+
+
+ + + + diff --git a/doc/html/group__usercb.js b/doc/html/group__usercb.js new file mode 100644 index 00000000..ec85d224 --- /dev/null +++ b/doc/html/group__usercb.js @@ -0,0 +1,46 @@ +var group__usercb = +[ + [ "lws_callback_function", "group__usercb.html#gad4fcb82e68d60ffacca61a3f783a0a2f", null ], + [ "lws_callback_reasons", "group__usercb.html#gad62860e19975ba4c4af401c3cdb6abf7", [ + [ "LWS_CALLBACK_ESTABLISHED", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a24d39bf1cfc0bad9d92da9ac1717e439", null ], + [ "LWS_CALLBACK_CLIENT_CONNECTION_ERROR", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7ad8c6207b0c4e732f3d507f0fb79370e8", null ], + [ "LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7aa536e574a642ff3ab9e12bff7ba2c6a2", null ], + [ "LWS_CALLBACK_CLIENT_ESTABLISHED", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a7e12418eec9bce85735e6460176ab604", null ], + [ "LWS_CALLBACK_CLOSED", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a48a9590e5e18c7920282e094a0bfd9d8", null ], + [ "LWS_CALLBACK_CLOSED_HTTP", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a838b18d255c1b94a533287ba302a2eba", null ], + [ "LWS_CALLBACK_RECEIVE", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a492c1b1c0ac0ed980042ee732fe2990c", null ], + [ "LWS_CALLBACK_RECEIVE_PONG", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a2db02fc6e1c17ab62b52109d1aa9d738", null ], + [ "LWS_CALLBACK_CLIENT_RECEIVE", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7abbbe7a0a67c5866ca9109d46823fc5b1", null ], + [ "LWS_CALLBACK_CLIENT_RECEIVE_PONG", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a136a7cec11c3afd13245623bd84e76c9", null ], + [ "LWS_CALLBACK_CLIENT_WRITEABLE", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a8e8b2e6dbeac76d8d126947d2166a514", null ], + [ "LWS_CALLBACK_SERVER_WRITEABLE", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a7ec8e2e9557ee02a4fc9f7dec7e2babc", null ], + [ "LWS_CALLBACK_HTTP", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7ae8d1de0bb56e03aa58cb4d44b18edd2e", null ], + [ "LWS_CALLBACK_HTTP_BODY", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7ac4c68e00efcf1ff7bda7ada462aff8ae", null ], + [ "LWS_CALLBACK_HTTP_BODY_COMPLETION", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a2fce9a8608220f32abbf1422a5498804", null ], + [ "LWS_CALLBACK_HTTP_FILE_COMPLETION", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7aa627548e1296e654fcfab463ec3c9587", null ], + [ "LWS_CALLBACK_HTTP_WRITEABLE", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7afedadfb3cde37a8ea4c84ed535f26d09", null ], + [ "LWS_CALLBACK_FILTER_NETWORK_CONNECTION", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a026502768778b8d79d62dd0fe4375fc6", null ], + [ "LWS_CALLBACK_FILTER_HTTP_CONNECTION", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a75199176c82c1a56e4a6bbf1cc30c12c", null ], + [ "LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7ae9734e1d7af2abf291665ce9e4a728d3", null ], + [ "LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7accd8753672d319a30b4b4c2fb775e84d", null ], + [ "LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7ae4986291b7a810fe290851d73bebeb1c", null ], + [ "LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a06006e98d27e1e884364d88317f83493", null ], + [ "LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7ae5ad65d779b7eab32ab67ceff91a3bac", null ], + [ "LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a909cc2a7018864b0b71abacc4058fd8f", null ], + [ "LWS_CALLBACK_CONFIRM_EXTENSION_OKAY", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a390da3639296660a78cc1a5dcb19037e", null ], + [ "LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a1ce5b22039ca37ee224d00047596ea46", null ], + [ "LWS_CALLBACK_PROTOCOL_INIT", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7ad5d34583e3556e153eda91620b48cc49", null ], + [ "LWS_CALLBACK_PROTOCOL_DESTROY", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a54269ca88508e6efd3afdb9d360a9caa", null ], + [ "LWS_CALLBACK_WSI_CREATE", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7afd8fd77a1cc9405fcb4f26915d7f2d01", null ], + [ "LWS_CALLBACK_WSI_DESTROY", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7aca834dc035b7f7486f9ce40fde54fe9e", null ], + [ "LWS_CALLBACK_GET_THREAD_ID", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7adfb41c92e2522712207ef7f2462b5e34", null ], + [ "LWS_CALLBACK_ADD_POLL_FD", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7ab69783a9fbf2ca71ad70706bda77b412", null ], + [ "LWS_CALLBACK_DEL_POLL_FD", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a1df60f314710236f9b53efbf468da768", null ], + [ "LWS_CALLBACK_CHANGE_MODE_POLL_FD", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7aa87d2e82fffa42c3680c7403ef94216e", null ], + [ "LWS_CALLBACK_LOCK_POLL", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a8909732521d379179003d97ab7a05428", null ], + [ "LWS_CALLBACK_UNLOCK_POLL", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a0e9e3dd667c0c42cdbe1a3d921f4fd79", null ], + [ "LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7aa46f705dcf97502e95627ffde614f98b", null ], + [ "LWS_CALLBACK_WS_PEER_INITIATED_CLOSE", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7ac3fc5bbb55e69f90396526287ee84a51", null ], + [ "LWS_CALLBACK_USER", "group__usercb.html#ggad62860e19975ba4c4af401c3cdb6abf7a982579753e70e59a9ea13ce628ac891a", null ] + ] ] +]; \ No newline at end of file diff --git a/doc/html/group__uv.html b/doc/html/group__uv.html new file mode 100644 index 00000000..067ba423 --- /dev/null +++ b/doc/html/group__uv.html @@ -0,0 +1,106 @@ + + + + + + +libwebsockets: libuv helpers + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
libuv helpers
+
+
+ + + + + + + + + + + + + + +

+Functions

+LWS_VISIBLE LWS_EXTERN int lws_uv_sigint_cfg (struct lws_context *context, int use_uv_sigint, uv_signal_cb cb)
 
+LWS_VISIBLE LWS_EXTERN void lws_libuv_run (const struct lws_context *context, int tsi)
 
+LWS_VISIBLE LWS_EXTERN void lws_libuv_stop (struct lws_context *context)
 
+LWS_VISIBLE LWS_EXTERN int lws_uv_initloop (struct lws_context *context, uv_loop_t *loop, int tsi)
 
+LWS_VISIBLE LWS_EXTERN uv_loop_t * lws_uv_getloop (struct lws_context *context, int tsi)
 
+LWS_VISIBLE LWS_EXTERN void lws_uv_sigint_cb (uv_signal_t *watcher, int signum)
 
+

Detailed Description

+

libuv helpers

+

APIs specific to libuv event loop itegration

+
+
+ + + + diff --git a/doc/html/group__vhost-mounts.html b/doc/html/group__vhost-mounts.html new file mode 100644 index 00000000..4143d018 --- /dev/null +++ b/doc/html/group__vhost-mounts.html @@ -0,0 +1,153 @@ + + + + + + +libwebsockets: Vhost mounts and options + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Vhost mounts and options
+
+
+ + + + + + +

+Data Structures

struct  lws_protocol_vhost_options
 
struct  lws_http_mount
 
+ + + +

+Enumerations

enum  lws_mount_protocols {
+  LWSMPRO_HTTP = 0, +LWSMPRO_HTTPS = 1, +LWSMPRO_FILE = 2, +LWSMPRO_CGI = 3, +
+  LWSMPRO_REDIR_HTTP = 4, +LWSMPRO_REDIR_HTTPS = 5, +LWSMPRO_CALLBACK = 6 +
+ }
 
+

Detailed Description

+

Vhost mounts and options

+

Enumeration Type Documentation

+ +
+
+ + + + +
enum lws_mount_protocols
+
+ +

#include <lib/libwebsockets.h>

+

enum lws_mount_protocols This specifies the mount protocol for a mountpoint, whether it is to be served from a filesystem, or it is a cgi etc.

+ + + + + + + + +
Enumerator
LWSMPRO_HTTP  +

not supported yet

+
LWSMPRO_HTTPS  +

not supported yet

+
LWSMPRO_FILE  +

serve from filesystem directory

+
LWSMPRO_CGI  +

pass to CGI to handle

+
LWSMPRO_REDIR_HTTP  +

redirect to http:// url

+
LWSMPRO_REDIR_HTTPS  +

redirect to https:// url

+
LWSMPRO_CALLBACK  +

hand by named protocol's callback

+
+
1745  {
1746  LWSMPRO_HTTP = 0,
1747  LWSMPRO_HTTPS = 1,
1748  LWSMPRO_FILE = 2,
1749  LWSMPRO_CGI = 3,
1750  LWSMPRO_REDIR_HTTP = 4,
1751  LWSMPRO_REDIR_HTTPS = 5,
1752  LWSMPRO_CALLBACK = 6,
1753 };
Definition: libwebsockets.h:1749
+
Definition: libwebsockets.h:1747
+
Definition: libwebsockets.h:1748
+
Definition: libwebsockets.h:1750
+
Definition: libwebsockets.h:1751
+
Definition: libwebsockets.h:1746
+
Definition: libwebsockets.h:1752
+
+
+
+
+
+ + + + diff --git a/doc/html/group__vhost-mounts.js b/doc/html/group__vhost-mounts.js new file mode 100644 index 00000000..cbae6e7f --- /dev/null +++ b/doc/html/group__vhost-mounts.js @@ -0,0 +1,36 @@ +var group__vhost_mounts = +[ + [ "lws_protocol_vhost_options", "structlws__protocol__vhost__options.html", [ + [ "name", "structlws__protocol__vhost__options.html#acf9db77f8eb64cd4e314be9b43d8a8b9", null ], + [ "next", "structlws__protocol__vhost__options.html#abc714ddb4171756fc8196e9823a1e21c", null ], + [ "options", "structlws__protocol__vhost__options.html#afd99fbc90be51ea2465b550c2ec47822", null ], + [ "value", "structlws__protocol__vhost__options.html#a0640a92513c70ee6b9b295a9ad1658e7", null ] + ] ], + [ "lws_http_mount", "structlws__http__mount.html", [ + [ "auth_mask", "structlws__http__mount.html#a614364c770b0bd4db464ad65cddab477", null ], + [ "cache_intermediaries", "structlws__http__mount.html#aabec1a326780aafe11b977000983be0c", null ], + [ "cache_max_age", "structlws__http__mount.html#a4283e30ea89d27ae7d061ad760d1d146", null ], + [ "cache_reusable", "structlws__http__mount.html#a8316dd183ffbef50419a5a4968d35d84", null ], + [ "cache_revalidate", "structlws__http__mount.html#ae137203040c6153694bd88a708da5395", null ], + [ "cgi_timeout", "structlws__http__mount.html#a4a7239d6d4c03986e6e1a72abb6c83aa", null ], + [ "cgienv", "structlws__http__mount.html#ae7b5c0f4c5408061e6ea3a8d281f45af", null ], + [ "def", "structlws__http__mount.html#ae90d1efe7178199fad39de2926902ee4", null ], + [ "extra_mimetypes", "structlws__http__mount.html#a4437423df85ee3dbcae0e15974c89ec7", null ], + [ "interpret", "structlws__http__mount.html#a11ea62b952710d59733dbcf9794a5773", null ], + [ "mount_next", "structlws__http__mount.html#ad878546ae1c399bbca7d7f8a0baf973d", null ], + [ "mountpoint", "structlws__http__mount.html#aa2391bfcada0b7a290b3c6651f64586c", null ], + [ "mountpoint_len", "structlws__http__mount.html#ac8489b60b8f969eb19c9abbdeac90743", null ], + [ "origin", "structlws__http__mount.html#a21d86fd6043ec00e121ababbc29af39a", null ], + [ "origin_protocol", "structlws__http__mount.html#a6a9b1492a0b9749e39bd19932717a0b7", null ], + [ "protocol", "structlws__http__mount.html#a05347d92c3d379809564bd4f3eab259b", null ] + ] ], + [ "lws_mount_protocols", "group__vhost-mounts.html#ga31eca18e50cb4357480f2fcad36ff437", [ + [ "LWSMPRO_HTTP", "group__vhost-mounts.html#gga31eca18e50cb4357480f2fcad36ff437a1e9f0842b0e85db50fe648ed4ba9a4b0", null ], + [ "LWSMPRO_HTTPS", "group__vhost-mounts.html#gga31eca18e50cb4357480f2fcad36ff437afbd10eb4777517ed1f6bfdcf3b9ea1d1", null ], + [ "LWSMPRO_FILE", "group__vhost-mounts.html#gga31eca18e50cb4357480f2fcad36ff437a42f2361cfe76cd287fa8fcfc502357e2", null ], + [ "LWSMPRO_CGI", "group__vhost-mounts.html#gga31eca18e50cb4357480f2fcad36ff437a13ab58b01ac6e05f595977f1e0f0db69", null ], + [ "LWSMPRO_REDIR_HTTP", "group__vhost-mounts.html#gga31eca18e50cb4357480f2fcad36ff437aec137a2434851bd856ceebfb697b9970", null ], + [ "LWSMPRO_REDIR_HTTPS", "group__vhost-mounts.html#gga31eca18e50cb4357480f2fcad36ff437a8894d16316863077dfe530963ca59f67", null ], + [ "LWSMPRO_CALLBACK", "group__vhost-mounts.html#gga31eca18e50cb4357480f2fcad36ff437a946a88cf9c852eed2c0317f4115d19da", null ] + ] ] +]; \ No newline at end of file diff --git a/doc/html/group__wsclose.html b/doc/html/group__wsclose.html new file mode 100644 index 00000000..91cb3c3d --- /dev/null +++ b/doc/html/group__wsclose.html @@ -0,0 +1,238 @@ + + + + + + +libwebsockets: Websocket Close + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Websocket Close
+
+
+ + + + +

+Enumerations

enum  lws_close_status {
+  LWS_CLOSE_STATUS_NOSTATUS = 0, +LWS_CLOSE_STATUS_NORMAL = 1000, +LWS_CLOSE_STATUS_GOINGAWAY = 1001, +LWS_CLOSE_STATUS_PROTOCOL_ERR = 1002, +
+  LWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003, +LWS_CLOSE_STATUS_RESERVED = 1004, +LWS_CLOSE_STATUS_NO_STATUS = 1005, +LWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006, +
+  LWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007, +LWS_CLOSE_STATUS_POLICY_VIOLATION = 1008, +LWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009, +LWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010, +
+  LWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011, +LWS_CLOSE_STATUS_TLS_FAILURE = 1015, +LWS_CLOSE_STATUS_NOSTATUS_CONTEXT_DESTROY = 9999 +
+ }
 
+ + + +

+Functions

LWS_VISIBLE LWS_EXTERN void lws_close_reason (struct lws *wsi, enum lws_close_status status, unsigned char *buf, size_t len)
 
+

Detailed Description

+

Websocket close frame control

+

When we close a ws connection, we can send a reason code and a short UTF-8 description back with the close packet.

+

Enumeration Type Documentation

+ +
+
+ + + + +
enum lws_close_status
+
+ +

#include <lib/libwebsockets.h>

+

enum lws_close_status - RFC6455 close status codes

+ + + + + + + + + + + + + + +
Enumerator
LWS_CLOSE_STATUS_NORMAL  +

1000 indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled.

+
LWS_CLOSE_STATUS_GOINGAWAY  +

1001 indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page.

+
LWS_CLOSE_STATUS_PROTOCOL_ERR  +

1002 indicates that an endpoint is terminating the connection due to a protocol error.

+
LWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE  +

1003 indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message).

+
LWS_CLOSE_STATUS_RESERVED  +

Reserved. The specific meaning might be defined in the future.

+
LWS_CLOSE_STATUS_NO_STATUS  +

1005 is a reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that no status code was actually present.

+
LWS_CLOSE_STATUS_ABNORMAL_CLOSE  +

1006 is a reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that the connection was closed abnormally, e.g., without sending or receiving a Close control frame.

+
LWS_CLOSE_STATUS_INVALID_PAYLOAD  +

1007 indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [RFC3629] data within a text message).

+
LWS_CLOSE_STATUS_POLICY_VIOLATION  +

1008 indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy.

+
LWS_CLOSE_STATUS_MESSAGE_TOO_LARGE  +

1009 indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process.

+
LWS_CLOSE_STATUS_EXTENSION_REQUIRED  +

1010 indicates that an endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake. The list of extensions that are needed SHOULD appear in the /reason/ part of the Close frame. Note that this status code is not used by the server, because it can fail the WebSocket handshake instead

+
LWS_CLOSE_STATUS_UNEXPECTED_CONDITION  +

1011 indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.

+
LWS_CLOSE_STATUS_TLS_FAILURE  +

1015 is a reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).

+
+
461  {
462  LWS_CLOSE_STATUS_NOSTATUS = 0,
524  /****** add new things just above ---^ ******/
525 
526  LWS_CLOSE_STATUS_NOSTATUS_CONTEXT_DESTROY = 9999,
527 };
Definition: libwebsockets.h:490
+
Definition: libwebsockets.h:501
+
Definition: libwebsockets.h:517
+
Definition: libwebsockets.h:469
+
Definition: libwebsockets.h:495
+
Definition: libwebsockets.h:479
+
Definition: libwebsockets.h:484
+
Definition: libwebsockets.h:466
+
Definition: libwebsockets.h:505
+
Definition: libwebsockets.h:463
+
Definition: libwebsockets.h:472
+
Definition: libwebsockets.h:477
+
Definition: libwebsockets.h:513
+
+
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LWS_VISIBLE LWS_EXTERN void lws_close_reason (struct lws * wsi,
enum lws_close_status status,
unsigned char * buf,
size_t len 
)
+
+ +

#include <lib/libwebsockets.h>

+

lws_close_reason - Set reason and aux data to send with Close packet If you are going to return nonzero from the callback requesting the connection to close, you can optionally call this to set the reason the peer will be told if possible.

+
Parameters
+ + + + + + +
wsiThe websocket connection to set the close reason on
statusA valid close status from websocket standard
bufNULL or buffer containing up to 124 bytes of auxiliary data
lenLength of data in
bufto send
+
+
+ +
+
+
+
+ + + + diff --git a/doc/html/group__wsclose.js b/doc/html/group__wsclose.js new file mode 100644 index 00000000..7bb301d3 --- /dev/null +++ b/doc/html/group__wsclose.js @@ -0,0 +1,19 @@ +var group__wsclose = +[ + [ "lws_close_status", "group__wsclose.html#gae399c571df32ba532c0ca67da9284985", [ + [ "LWS_CLOSE_STATUS_NORMAL", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985a3ffa38d5081b85fb739e02a747ccf2c4", null ], + [ "LWS_CLOSE_STATUS_GOINGAWAY", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985a9737a68759e739856b150ff9dfa30218", null ], + [ "LWS_CLOSE_STATUS_PROTOCOL_ERR", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985a1bb501d212fa4d57053db681b1dfab98", null ], + [ "LWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985a462c99b05459df700919cfd3f53c8276", null ], + [ "LWS_CLOSE_STATUS_RESERVED", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985af90cb98d983ad3d4c79df9b6f3d4a4d2", null ], + [ "LWS_CLOSE_STATUS_NO_STATUS", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985a4b8a3b7ce6f731e5248e4b0fb64a5044", null ], + [ "LWS_CLOSE_STATUS_ABNORMAL_CLOSE", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985a68b3d34bebd88547dcfa5cadba0acd6c", null ], + [ "LWS_CLOSE_STATUS_INVALID_PAYLOAD", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985a7aef2da0062da606eeb35aaca5cf9050", null ], + [ "LWS_CLOSE_STATUS_POLICY_VIOLATION", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985ad09e68295eabdddcba4e332fbea70ae5", null ], + [ "LWS_CLOSE_STATUS_MESSAGE_TOO_LARGE", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985a2e1f0113494a58e762eed3d22e7080d8", null ], + [ "LWS_CLOSE_STATUS_EXTENSION_REQUIRED", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985ac6a161822783ee873be1c66f48d14e0e", null ], + [ "LWS_CLOSE_STATUS_UNEXPECTED_CONDITION", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985ad0869604d79e13700ae5d196a431b350", null ], + [ "LWS_CLOSE_STATUS_TLS_FAILURE", "group__wsclose.html#ggae399c571df32ba532c0ca67da9284985ad2b477a91c8445bf34ecd43977f9b390", null ] + ] ], + [ "lws_close_reason", "group__wsclose.html#gaa1c863415d1783cd8de7938aa6efa262", null ] +]; \ No newline at end of file diff --git a/doc/html/group__wsstatus.html b/doc/html/group__wsstatus.html new file mode 100644 index 00000000..ec084d5b --- /dev/null +++ b/doc/html/group__wsstatus.html @@ -0,0 +1,279 @@ + + + + + + +libwebsockets: Websocket status APIs + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+
Websocket status APIs
+
+
+ + + + + + + + + + + + + + + + +

+Functions

LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_send_pipe_choked (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN int lws_is_final_fragment (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN unsigned char lws_get_reserved_bits (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_partial_buffered (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_frame_is_binary (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN int lws_is_ssl (struct lws *wsi)
 
LWS_VISIBLE LWS_EXTERN int lws_is_cgi (struct lws *wsi)
 
+

Detailed Description

+

Websocket connection status APIs

+

These provide information about ws connection or message status

+

Function Documentation

+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_frame_is_binary (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_frame_is_binary(): true if the current frame was sent in binary mode

+
Parameters
+ + +
wsithe connection we are inquiring about
+
+
+

This is intended to be called from the LWS_CALLBACK_RECEIVE callback if it's interested to see if the frame it's dealing with was sent in binary mode.

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN unsigned char lws_get_reserved_bits (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_get_reserved_bits() - access reserved bits of ws frame

Parameters
+ + +
wsilws connection
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_is_cgi (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_is_cgi() - find out if this wsi is running a cgi process

Parameters
+ + +
wsilws connection
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_is_final_fragment (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_is_final_fragment() - tests if last part of ws message

Parameters
+ + +
wsilws connection
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int lws_is_ssl (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_is_ssl() - Find out if connection is using SSL

Parameters
+ + +
wsiwebsocket connection to check
 Returns 0 if the connection is not using SSL, 1 if using SSL and
+ using verified cert, and 2 if using SSL but the cert was not
+ checked (appears for client wsi told to skip check on connection)
+
+
+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_partial_buffered (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_partial_buffered() - find out if lws buffered the last write

Parameters
+ + +
wsiwebsocket connection to check
+
+
+

Returns 1 if you cannot use lws_write because the last write on this connection is still buffered, and can't be cleared without returning to the service loop and waiting for the connection to be writeable again.

+

If you will try to do >1 lws_write call inside a single WRITEABLE callback, you must check this after every write and bail if set, ask for a new writeable callback and continue writing from there.

+

This is never set at the start of a writeable callback, but any write may set it.

+ +
+
+ +
+
+ + + + + + + + +
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_send_pipe_choked (struct lws * wsi)
+
+ +

#include <lib/libwebsockets.h>

+

lws_send_pipe_choked() - tests if socket is writable or not

Parameters
+ + +
wsilws connection
+
+
+

Allows you to check if you can write more on the socket

+ +
+
+
+
+ + + + diff --git a/doc/html/group__wsstatus.js b/doc/html/group__wsstatus.js new file mode 100644 index 00000000..1f198aa3 --- /dev/null +++ b/doc/html/group__wsstatus.js @@ -0,0 +1,10 @@ +var group__wsstatus = +[ + [ "lws_frame_is_binary", "group__wsstatus.html#gaccd9c59336efad8af0554f79cc5966fd", null ], + [ "lws_get_reserved_bits", "group__wsstatus.html#ga3df5045656dfb6b0e63a38de2dca79d2", null ], + [ "lws_is_cgi", "group__wsstatus.html#ga4ad226d5e01024b4046f4a5a37199aa1", null ], + [ "lws_is_final_fragment", "group__wsstatus.html#ga08e9ee165fca503fd9427d55cfecac37", null ], + [ "lws_is_ssl", "group__wsstatus.html#ga26a140623d202dd2bf2004deb6994baa", null ], + [ "lws_partial_buffered", "group__wsstatus.html#gaeca4afc94b1f026034f99cbba37e2f85", null ], + [ "lws_send_pipe_choked", "group__wsstatus.html#ga2bb3655329b4651cd06f79ee3a764421", null ] +]; \ No newline at end of file diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html new file mode 100644 index 00000000..b3776bc1 --- /dev/null +++ b/doc/html/hierarchy.html @@ -0,0 +1,118 @@ + + + + + + +libwebsockets: Class Hierarchy + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + + +
+
+ +
+
+
+ + + + + + diff --git a/doc/html/hierarchy.js b/doc/html/hierarchy.js new file mode 100644 index 00000000..06dcc439 --- /dev/null +++ b/doc/html/hierarchy.js @@ -0,0 +1,31 @@ +var hierarchy = +[ + [ "lws_cgi_args", "structlws__cgi__args.html", null ], + [ "lws_client_connect_info", "structlws__client__connect__info.html", null ], + [ "lws_conn", "classlws__conn.html", [ + [ "lws_conn_listener", "classlws__conn__listener.html", null ] + ] ], + [ "lws_context_creation_info", "structlws__context__creation__info.html", null ], + [ "lws_email", "structlws__email.html", null ], + [ "lws_ext_option_arg", "structlws__ext__option__arg.html", null ], + [ "lws_ext_options", "structlws__ext__options.html", null ], + [ "lws_extension", "structlws__extension.html", null ], + [ "lws_gs_event_args", "structlws__gs__event__args.html", null ], + [ "lws_http_mount", "structlws__http__mount.html", null ], + [ "lws_plat_file_ops", "structlws__plat__file__ops.html", null ], + [ "lws_plugin", "structlws__plugin.html", null ], + [ "lws_plugin_capability", "structlws__plugin__capability.html", null ], + [ "lws_polarssl_context", "structlws__polarssl__context.html", null ], + [ "lws_pollargs", "structlws__pollargs.html", null ], + [ "lws_pollfd", "structlws__pollfd.html", null ], + [ "lws_process_html_args", "structlws__process__html__args.html", null ], + [ "lws_process_html_state", "structlws__process__html__state.html", null ], + [ "lws_protocol_vhost_options", "structlws__protocol__vhost__options.html", null ], + [ "lws_protocols", "structlws__protocols.html", null ], + [ "lws_session_info", "structlws__session__info.html", null ], + [ "lws_token_limits", "structlws__token__limits.html", null ], + [ "lws_tokens", "structlws__tokens.html", null ], + [ "lwsgw_hash", "structlwsgw__hash.html", null ], + [ "lwsgw_hash_bin", "structlwsgw__hash__bin.html", null ], + [ "pollfd", "structpollfd.html", null ] +]; \ No newline at end of file diff --git a/doc/html/index.html b/doc/html/index.html new file mode 100644 index 00000000..a0f78a50 --- /dev/null +++ b/doc/html/index.html @@ -0,0 +1,90 @@ + + + + + + +libwebsockets: Libwebsockets API introduction + + + + + + + + + + + +
+
+ + + + + + + +
+
libwebsockets +
+
Lightweight C library for HTML5 websockets
+
+
+ + + +
+
+ +
+
+
+ +
+
+
+
Libwebsockets API introduction
+
+
+

Libwebsockets covers a lot of interesting features for people making embedded servers or clients

+
    +
  • http(s) serving and client operation
  • +
  • ws(s) serving and client operation
  • +
  • http(s) apis for file transfer and upload
  • +
  • http POST form handling (including multipart)
  • +
  • cookie-based sessions
  • +
  • account management (including registration, email verification, lost pw etc)
  • +
  • strong ssl PFS support (A+ on SSLlabs test)
  • +
+

You can browse by api category here.

+
+
+ + + + diff --git a/doc/html/jquery.js b/doc/html/jquery.js new file mode 100644 index 00000000..1f4d0b47 --- /dev/null +++ b/doc/html/jquery.js @@ -0,0 +1,68 @@ +/*! + * jQuery JavaScript Library v1.7.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Mon Nov 21 21:11:03 2011 -0500 + */ +(function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
t
";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
","
"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! + * jQuery UI 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! + * jQuery UI Widget 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! + * jQuery UI Mouse 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! + * jQuery hashchange event - v1.3 - 7/21/2010 + * http://benalman.com/projects/jquery-hashchange-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('