import "golang.org/x/tools/playground/socket"
Package socket implements an WebSocket-based playground backend. Clients connect to a websocket handler and send run/kill commands, and the server sends the output and exit status of the running processes. Multiple clients running multiple processes may be served concurrently. The wire format is JSON and is described by the Message type.
This will not run on App Engine as WebSockets are not supported there.
Environ provides an environment when a binary, such as the go tool, is invoked.
RunScripts specifies whether the socket handler should execute shell scripts (snippets that start with a shebang).
NewHandler returns a websocket server which checks the origin of requests.
type Message struct { Id string // client-provided unique id for the process Kind string // in: "run", "kill" out: "stdout", "stderr", "end" Body string Options *Options `json:",omitempty"` }
Message is the wire format for the websocket connection to the browser. It is used for both sending output messages and receiving commands, as distinguished by the Kind field.
Options specify additional message options.
Package socket imports 20 packages (graph) and is imported by 6 packages. Updated 2 days ago. Refresh now. Tools for package owners.