command
module
Version:
v0.0.0-...-f1bc933
Opens a new window with list of versions in this module.
Published: Aug 9, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
1. Chat Demo
这是一个简单的websocket协议demo。
1.1. 环境准备
1.1.1. 安装Golang
打开 https://golang.google.cn/dl/ ,下载对应的安装包。
在Mac下可以在终端执行:
brew install golang
1.1.2. 代理设置
打开你的终端并执行
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
https://goproxy.cn/
1.1.3. 安装VSCODE
从 https://code.visualstudio.com/ 下载Visual Studio Code
。
安装完vscode之后,就可以打开本demo项目了,它会提示你安装一些扩展和Golang的环境工具
,确认安装即可。
1.2. 启动服务
go run main.go chat
$ go run main.go chat
INFO[0000] started id=demo listen=":8000" module=Server
1.3. 测试
打开两个websocket测试界面中,并分别输入:
ws://localhost:8000?user=userA
ws://localhost:8000?user=userB
之后就可以通过界面发送聊天消息了
1.4. Java to Go
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.