mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-22 01:15:12 +00:00
bump(code.google.com/p/go.net/websocket): 7127eefd36
Add code.google.com/p/go.net/websocket to deps.sh and run update.sh.
This commit is contained in:
26
third_party/src/code.google.com/p/go.net/websocket/examplehandler_test.go
vendored
Normal file
26
third_party/src/code.google.com/p/go.net/websocket/examplehandler_test.go
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2012 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package websocket_test
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"code.google.com/p/go.net/websocket"
|
||||
)
|
||||
|
||||
// Echo the data received on the WebSocket.
|
||||
func EchoServer(ws *websocket.Conn) {
|
||||
io.Copy(ws, ws)
|
||||
}
|
||||
|
||||
// This example demonstrates a trivial echo server.
|
||||
func ExampleHandler() {
|
||||
http.Handle("/echo", websocket.Handler(EchoServer))
|
||||
err := http.ListenAndServe(":12345", nil)
|
||||
if err != nil {
|
||||
panic("ListenAndServe: " + err.Error())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user