云盘
志元云盘
备份云盘
Home
/
志元云盘
/
webdav
/
sync
/
go
/
pkg
/
mod
/
github.com
/
gorilla
/
[email protected]
/
examples
/
command
File
OriginalPic
Thumbnails
CopyAllDownloadUrl
EditTime
Size
home.html
2024-10-10 17:26:40
2.21 KB
main.go
2024-10-10 17:26:40
4.08 KB
README.md
2024-10-10 17:26:40
616 B
# Command example This example connects a websocket connection to stdin and stdout of a command. Received messages are written to stdin followed by a `\n`. Each line read from standard out is sent as a message to the client. $ go get github.com/gorilla/websocket $ cd `go list -f '{{.Dir}}' github.com/gorilla/websocket/examples/command` $ go run main.go
# Open http://localhost:8080/ . Try the following commands. # Echo sent messages to the output area. $ go run main.go cat # Run a shell.Try sending "ls" and "cat main.go". $ go run main.go sh
2025-09-04 18:13:05 Thursday 216.73.216.121 Runningtime:0.022s Mem:1.47 MB