Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 1d5c822

Browse files
authored
Merge pull request #28 from mouyong/master
添加 websocket 测试代码
2 parents 66f3fd2 + 500027b commit 1d5c822

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ location /ws {
110110
proxy_set_header Connection 'Upgrade';
111111
}
112112
```
113+
test connection to websocket
114+
115+
```
116+
var ws = new WebSocket('ws://127.0.0.1:7000/ws')
117+
ws.onmessage = function (data) {
118+
console.log("server response ws data: " + data)
119+
}
120+
121+
ws.send('send message test from client')
122+
```
113123

114124

115125
### Thanks

0 commit comments

Comments
 (0)