Download Luar/moonloader/lib/examples/h2_streaming.lua from andy-gg/LUAR_RP_PC: direct link, hf CLI and curl.
- Browser
- Download file 431 Bytes
-
https://huggingface.co/datasets/andy-gg/LUAR_RP_PC/resolve/main/Luar/moonloader/lib/examples/h2_streaming.lua
- Command line
-
hf download hf://datasets/andy-gg/LUAR_RP_PC/Luar/moonloader/lib/examples/h2_streaming.lua
-
curl -L -o h2_streaming.lua https://huggingface.co/datasets/andy-gg/LUAR_RP_PC/resolve/main/Luar/moonloader/lib/examples/h2_streaming.lua
431 Bytes
| #!/usr/bin/env lua | |
| --[[ | |
| Makes a request to an HTTP2 endpoint that has an infinite length response. | |
| Usage: lua examples/h2_streaming.lua | |
| ]] | |
| local request = require "http.request" | |
| -- This endpoint returns a never-ending stream of chunks containing the current time | |
| local req = request.new_from_uri("https://http2.golang.org/clockstream") | |
| local _, stream = assert(req:go()) | |
| for chunk in stream:each_chunk() do | |
| io.write(chunk) | |
| end | |