1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/doc/html
Andy Green ed4acef481 RFC7233 HTTP Ranges support for server
This adds a serverside implementation of RFC7233 HTTP ranges.

 - LWS_WITH_RANGES is on by default at cmake

 - Accept-Ranges: bytes is added if LWS_WITH_RANGES is enabled

 - Both single ranges and multipart (2+) ranges are supported

Test with curl like this

Single

$ $ curl -s -r 64-95  http://localhost:7681/libwebsockets.org-logo.png  | hexdump -C
00000000  2e 01 fd 9d 12 27 00 00  00 19 74 45 58 74 53 6f  |.....'....tEXtSo|
00000010  66 74 77 61 72 65 00 77  77 77 2e 69 6e 6b 73 63  |ftware.www.inksc|

Multipart

$ curl -s -r 64-95,128-143  http://localhost:7681/libwebsockets.org-logo.png  | hexdump -C

00000000  5f 6c 77 73 0d 0a 43 6f  6e 74 65 6e 74 2d 54 79  |_lws..Content-Ty|
00000010  70 65 3a 20 69 6d 61 67  65 2f 70 6e 67 0d 0a 43  |pe: image/png..C|
00000020  6f 6e 74 65 6e 74 2d 52  61 6e 67 65 3a 20 62 79  |ontent-Range: by|
00000030  74 65 73 20 36 34 2d 39  35 2f 37 30 32 39 0d 0a  |tes 64-95/7029..|
00000040  0d 0a 2e 01 fd 9d 12 27  00 00 00 19 74 45 58 74  |.......'....tEXt|
00000050  53 6f 66 74 77 61 72 65  00 77 77 77 2e 69 6e 6b  |Software.www.ink|
00000060  73 63 5f 6c 77 73 0d 0a  43 6f 6e 74 65 6e 74 2d  |sc_lws..Content-|
00000070  54 79 70 65 3a 20 69 6d  61 67 65 2f 70 6e 67 0d  |Type: image/png.|
00000080  0a 43 6f 6e 74 65 6e 74  2d 52 61 6e 67 65 3a 20  |.Content-Range: |
00000090  62 79 74 65 73 20 31 32  38 2d 31 34 33 2f 37 30  |bytes 128-143/70|
000000a0  32 39 0d 0a 0d 0a 05 14  50 40 05 15 a5 c4 60 43  |29......P@....`C|
000000b0  91 c4 4a d4 c4 fc 5f 6c  77 73 0d 00              |..J..._lws..|

The corresponding header part is like this

	0x0030:            4854 5450 2f31 2e31 2032 3036      HTTP/1.1.206
	0x0040:  200d 0a73 6572 7665 723a 206c 7773 7773  ...server:.lwsws
	0x0050:  0d0a 636f 6e74 656e 742d 7479 7065 3a20  ..content-type:.
	0x0060:  6d75 6c74 6970 6172 742f 6279 7465 7261  multipart/bytera
	0x0070:  6e67 6573 0d0a 6163 6365 7074 2d72 616e  nges..accept-ran
	0x0080:  6765 733a 2062 7974 6573 0d0a 636f 6e74  ges:.bytes..cont
	0x0090:  656e 742d 6c65 6e67 7468 3a20 3138 380d  ent-length:.188.
	0x00a0:  0a63 6163 6865 2d63 6f6e 7472 6f6c 3a20  .cache-control:.
	0x00b0:  7072 6976 6174 6520 6d61 782d 6167 653a  private.max-age:
	0x00c0:  2036 300d 0a63 6f6e 6e65 6374 696f 6e3a  .60..connection:
	0x00d0:  206b 6565 702d 616c 6976 650d 0a65 7461  .keep-alive..eta
	0x00e0:  673a 2030 3030 3031 4237 3535 3444 3433  g:.00001B7554D43
	0x00f0:  3033 330d 0a0d 0a                        033....
2016-12-20 14:37:07 +08:00
..
annotated.html docs update 2016-12-16 22:08:13 +08:00
annotated_dup.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
arrowdown.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
arrowright.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
bc_s.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
bdwn.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
classes.html docs update 2016-12-16 22:08:13 +08:00
classlws__conn.html docs update 2016-12-16 22:08:13 +08:00
classlws__conn.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
classlws__conn.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
classlws__conn__listener.html docs update 2016-12-16 22:08:13 +08:00
classlws__conn__listener.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
classlws__conn__listener.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
closed.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
deprecated.html docs update 2016-12-16 22:08:13 +08:00
dir_97aefd0d527b934f1d99a682da8fe6a9.html docs update 2016-12-16 22:08:13 +08:00
dir_97aefd0d527b934f1d99a682da8fe6a9.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
dir_e8731c315d086bdbd43ee7d72e0ed36b.html docs update 2016-12-16 22:08:13 +08:00
doc.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
doxygen.css token:x-forwarded-for 2016-12-20 14:37:07 +08:00
doxygen.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
dynsections.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
files.html docs update 2016-12-16 22:08:13 +08:00
files.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
folderclosed.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
folderopen.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
functions.html token:x-forwarded-for 2016-12-20 14:37:07 +08:00
functions_func.html docs update 2016-12-16 22:08:13 +08:00
functions_vars.html token:x-forwarded-for 2016-12-20 14:37:07 +08:00
globals.html docs update 2016-12-16 22:08:13 +08:00
globals_dup.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
globals_enum.html docs update 2016-12-16 22:08:13 +08:00
globals_eval.html docs update 2016-12-16 22:08:13 +08:00
globals_func.html docs update 2016-12-16 22:08:13 +08:00
globals_l.html docs update 2016-12-16 22:08:13 +08:00
globals_type.html docs update 2016-12-16 22:08:13 +08:00
group__callback-when-writeable.html docs update 2016-12-16 22:08:13 +08:00
group__callback-when-writeable.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__cgi.html docs update 2016-12-16 22:08:13 +08:00
group__client.html token:x-forwarded-for 2016-12-20 14:37:07 +08:00
group__client.js client: add lws_http_client_http_response api 2016-12-16 22:08:13 +08:00
group__context-and-vhost.html docs update 2016-12-16 22:08:13 +08:00
group__context-and-vhost.js token:x-forwarded-for 2016-12-20 14:37:07 +08:00
group__ev.html docs update 2016-12-16 22:08:13 +08:00
group__extensions.html docs update 2016-12-16 22:08:13 +08:00
group__extensions.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__fops.html docs update 2016-12-16 22:08:13 +08:00
group__fops.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__form-parsing.html RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
group__form-parsing.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__generic-sessions.html docs update 2016-12-16 22:08:13 +08:00
group__generic-sessions.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__html-chunked-substitution.html RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
group__html-chunked-substitution.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__HTTP-headers-create.html docs update 2016-12-16 22:08:13 +08:00
group__HTTP-headers-create.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__HTTP-headers-read.html token:x-forwarded-for 2016-12-20 14:37:07 +08:00
group__HTTP-headers-read.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__http.html docs update 2016-12-16 22:08:13 +08:00
group__http.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__httpft.html docs update 2016-12-16 22:08:13 +08:00
group__httpft.js lws_get_mimetype 2016-07-14 08:57:27 +08:00
group__log.html docs update 2016-12-16 22:08:13 +08:00
group__log.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__misc.html docs update 2016-12-16 22:08:13 +08:00
group__misc.js lws_snprintf 2016-09-15 02:22:57 +08:00
group__net.html docs update 2016-12-16 22:08:13 +08:00
group__net.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__Protocols-and-Plugins.html docs update 2016-12-16 22:08:13 +08:00
group__Protocols-and-Plugins.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__pur.html docs update 2016-12-16 22:08:13 +08:00
group__pur.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__sending-data.html RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
group__sending-data.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__service.html docs update 2016-12-16 22:08:13 +08:00
group__service.js alias lws_plat_service_tsi to lws_service_tsi in public api 2016-12-16 22:08:12 +08:00
group__sha.html docs update 2016-12-16 22:08:13 +08:00
group__sha.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__smtp.html RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
group__smtp.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__sock-adopt.html docs update 2016-12-16 22:08:13 +08:00
group__sock-adopt.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__timeout.html docs update 2016-12-16 22:08:13 +08:00
group__timeout.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__urlendec.html docs update 2016-12-16 22:08:13 +08:00
group__urlendec.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__usercb.html docs update 2016-12-16 22:08:13 +08:00
group__usercb.js client-add-PUSH-http-body-capability 2016-08-10 21:23:01 +08:00
group__uv.html docs update 2016-12-16 22:08:13 +08:00
group__vhost-mounts.html token:x-forwarded-for 2016-12-20 14:37:07 +08:00
group__vhost-mounts.js token:x-forwarded-for 2016-12-20 14:37:07 +08:00
group__wsclose.html docs update 2016-12-16 22:08:13 +08:00
group__wsclose.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
group__wsstatus.html docs update 2016-12-16 22:08:13 +08:00
group__wsstatus.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
hierarchy.html docs update 2016-12-16 22:08:13 +08:00
hierarchy.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
index.html docs update 2016-12-16 22:08:13 +08:00
jquery.js docs update 2016-12-16 22:08:13 +08:00
libwebsockets.org-logo.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
libwebsockets_8h.html RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
libwebsockets_8h.js RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
libwebsockets_8h_source.html RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
lwsgt-overview.png plugin table dirlisting 2016-07-14 08:57:28 +08:00
md_README.build.html Subject: Fix some typographical and grammatical errors. 2016-10-03 21:31:27 +08:00
md_README.coding.html Subject: Fix some typographical and grammatical errors. 2016-10-03 21:31:27 +08:00
md_README.generic-sessions.html doxygen use sections 2016-07-14 08:57:28 +08:00
md_README.generic-table.html doxygen use sections 2016-07-14 08:57:28 +08:00
md_README.lwsws.html Add reject service keywords list 2016-10-13 06:32:57 +08:00
md_README.problems.html plugin table dirlisting 2016-07-14 08:57:28 +08:00
md_README.test-apps.html Subject: Fix some typographical and grammatical errors. 2016-10-03 21:31:27 +08:00
md_README_8build.html basic-auth 2016-12-16 22:08:13 +08:00
md_README_8coding.html basic-auth 2016-12-16 22:08:13 +08:00
md_README_8generic-sessions.html basic-auth 2016-12-16 22:08:13 +08:00
md_README_8generic-table.html basic-auth 2016-12-16 22:08:13 +08:00
md_README_8lwsws.html basic-auth 2016-12-16 22:08:13 +08:00
md_README_8problems.html basic-auth 2016-12-16 22:08:13 +08:00
md_README_8test-apps.html basic-auth 2016-12-16 22:08:13 +08:00
menu.js basic-auth 2016-12-16 22:08:13 +08:00
menudata.js token:x-forwarded-for 2016-12-20 14:37:07 +08:00
modules.html docs update 2016-12-16 22:08:13 +08:00
modules.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
nav_f.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
nav_g.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
nav_h.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
navtree.css docs update 2016-12-16 22:08:13 +08:00
navtree.js docs update 2016-12-16 22:08:13 +08:00
navtreedata.js RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
navtreeindex0.js RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
navtreeindex1.js RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
navtreeindex2.js RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
navtreeindex3.js RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
navtreeindex4.js RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
open.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
pages.html docs update 2016-12-16 22:08:13 +08:00
resize.js docs update 2016-12-16 22:08:13 +08:00
splitbar.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__cgi__args.html docs update 2016-12-16 22:08:13 +08:00
structlws__cgi__args.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__client__connect__info.html docs update 2016-12-16 22:08:13 +08:00
structlws__client__connect__info.js CLIENT_CONNECTION_ERROR add strings 2016-07-14 08:57:27 +08:00
structlws__context__creation__info.html token:x-forwarded-for 2016-12-20 14:37:07 +08:00
structlws__context__creation__info.js token:x-forwarded-for 2016-12-20 14:37:07 +08:00
structlws__email.html docs update 2016-12-16 22:08:13 +08:00
structlws__email.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__ext__option__arg.html docs update 2016-12-16 22:08:13 +08:00
structlws__ext__option__arg.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__ext__options.html docs update 2016-12-16 22:08:13 +08:00
structlws__ext__options.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__extension.html docs update 2016-12-16 22:08:13 +08:00
structlws__extension.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__gs__event__args.html docs update 2016-12-16 22:08:13 +08:00
structlws__gs__event__args.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__http__mount.html token:x-forwarded-for 2016-12-20 14:37:07 +08:00
structlws__http__mount.js token:x-forwarded-for 2016-12-20 14:37:07 +08:00
structlws__plat__file__ops.html docs update 2016-12-16 22:08:13 +08:00
structlws__plat__file__ops.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__plugin.html docs update 2016-12-16 22:08:13 +08:00
structlws__plugin.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__plugin__capability.html docs update 2016-12-16 22:08:13 +08:00
structlws__plugin__capability.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__polarssl__context.html docs update 2016-12-16 22:08:13 +08:00
structlws__polarssl__context.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__pollargs.html docs update 2016-12-16 22:08:13 +08:00
structlws__pollargs.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__pollfd.html docs update 2016-12-16 22:08:13 +08:00
structlws__pollfd.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__process__html__args.html docs update 2016-12-16 22:08:13 +08:00
structlws__process__html__args.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__process__html__state.html docs update 2016-12-16 22:08:13 +08:00
structlws__process__html__state.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__protocol__vhost__options.html docs update 2016-12-16 22:08:13 +08:00
structlws__protocol__vhost__options.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__protocols.html docs update 2016-12-16 22:08:13 +08:00
structlws__protocols.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__session__info.html docs update 2016-12-16 22:08:13 +08:00
structlws__session__info.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__token__limits.html docs update 2016-12-16 22:08:13 +08:00
structlws__token__limits.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlws__tokens.html docs update 2016-12-16 22:08:13 +08:00
structlws__tokens.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlwsgw__hash.html docs update 2016-12-16 22:08:13 +08:00
structlwsgw__hash.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structlwsgw__hash__bin.html docs update 2016-12-16 22:08:13 +08:00
structlwsgw__hash__bin.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
structpollfd.html docs update 2016-12-16 22:08:13 +08:00
structpollfd.js documentation convert to doxygen 2016-07-14 08:57:27 +08:00
sync_off.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
sync_on.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
tab_a.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
tab_b.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
tab_h.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
tab_s.png documentation convert to doxygen 2016-07-14 08:57:27 +08:00
tabs.css docs update 2016-12-16 22:08:13 +08:00