Skip to content

Commit

Permalink
update websocket example
Browse files Browse the repository at this point in the history
  • Loading branch information
name5566 committed Oct 22, 2015
1 parent 84cbe60 commit 33b84d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion TUTORIAL_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ ws.onopen = function() {
</script>
```

在 LeafServer 中,bin/conf/server.json 可以配置 WebSocket 监听地址(WSAddr):
保存上述代码到某 HTML 文件中并使用(任意支持 WebSocket 协议的)浏览器打开。在打开此 HTML 文件前,首先需要配置一下 LeafServer 的 bin/conf/server.json 文件,增加 WebSocket 监听地址(WSAddr):
```json
{
"LogLevel": "debug",
Expand All @@ -272,6 +272,12 @@ ws.onopen = function() {
}
```

重启游戏服务器后,方可接受 WebSocket 消息:

```
2015/09/25 07:50:03 [debug ] hello leaf
```

### Leaf 模块详解

LeafServer 中包含了 3 个模块,它们分别是:
Expand Down

0 comments on commit 33b84d4

Please sign in to comment.