>_ RESTERM
v1.18.2

examples Protocols

streaming.http

The @sse and @websocket directives side by side, against public test servers.

runs as-is

shell
resterm run --all _examples/streaming.http

Run this from the root of a clone of the Resterm repository.

Editor
### Server Sent Events Demo
# @name sseDemo
# @description Demonstrates streaming responses over SSE.
# @sse duration=30s idle=10s max-events=5
GET https://stream.wikimedia.org/v2/stream/recentchange
Accept: text/event-stream
User-Agent: resterm-examples (https://github.com/unkn0wn-root/resterm)

### WebSocket Chat Demo
# @name wsChat
# @description Sends a message over WebSocket and waits for a reply.
# @websocket idle=3s subprotocols=chat.v1
# @ws send Hello from resterm!
# @ws wait 1s
# @ws close 1000 normal closure
GET wss://echo.websocket.org

_examples/streaming.http on GitHub

WebSocket and SSE docs
Search

↑↓ moveEnter openEsc close

Help

These keys work like the ones in the TUI.

/
Search the docs (also Ctrl K)
j k
Scroll down and up
g g G
Jump to the top or the bottom
[ ]
Previous and next page
g d
Docs index
g h
Home page
t
Switch between dark and light
?
Show this help
Esc
Close a dialog