Skip to content

Commit 6045221

Browse files
authored
Merge pull request #395 from sshanks-kx/websocket
example websockets connection
2 parents f555e61 + 8568271 commit 6045221

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/kb/websockets.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ To open a client connection to a server, use the following syntax:
120120
```q
121121
(`$":ws://host:port")"GET / HTTP/1.1\r\nHost: host:port\r\n\r\n"
122122
```
123-
If successful it will return a 2-item list of (handle;HTTP response), e.g.
123+
For example, to establish a connection with a web server running on 127.0.0.1 (port 80), with the URI '/subscribe/wss' and virtual host www.kdb-testbox.com, run the following command:
124+
```q
125+
(`$":ws://127.0.0.1:80")"GET /subscribe/wss HTTP/1.1\r\nHost: www.kdb-testbox.com\r\n\r\n"
126+
```
127+
128+
If successful, it returns a two-item list of (handle;HTTP response), as follows:
124129
```q
125130
(3i;"HTTP/1.1 101 Switching Protocols\r\nConnection: Upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=\r\nSec-WebSocket-Extensions: permessage-deflate\r\n\r\n")
126131
```

0 commit comments

Comments
 (0)