Skip to content

Commit

Permalink
doc/modules/http.websocket.md: Add usage example to websocket:each()
Browse files Browse the repository at this point in the history
  • Loading branch information
hollunder committed Jul 19, 2018
1 parent 921e04d commit d06eb6e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/modules/http.websocket.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ The opcode `0x1` will be returned as `"text"` and `0x2` will be returned as `"bi

Iterator over [`websocket:receive()`](#http.websocket:receive).

#### Example {#http.websocket:each-example}

```lua
local ws = websocket.new_from_uri("wss://echo.websocket.org")
assert(ws:connect())

for data, opcode in ws:each() do
print(data, opcode)
end
```

### `websocket:send_frame(frame, timeout)` <!-- --> {#http.websocket:send_frame}

Expand Down

0 comments on commit d06eb6e

Please sign in to comment.