Documentation ¶
Index ¶
- Variables
- func Mirror(conn *websocket.Conn, rwc io.ReadWriteCloser) (chan error, chan error)
- func MirrorRead(conn *websocket.Conn, rc io.Reader) chan error
- func MirrorWrite(conn *websocket.Conn, wc io.Writer) chan error
- func NewWrapper(conn *websocket.Conn) io.ReadWriteCloser
- func Proxy(source *websocket.Conn, target *websocket.Conn) chan struct{}
Constants ¶
This section is empty.
Variables ¶
View Source
var Upgrader = websocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { return true }, HandshakeTimeout: time.Second * 5, }
Upgrader is a websocket upgrader which ignores the request Origin.
Functions ¶
func Mirror ¶
Mirror takes a websocket and replicates all read/write to a ReadWriteCloser. Returns channels indicating when reads and writes are finished (respectively).
func MirrorRead ¶
MirrorRead is a uni-directional mirror which replicates an io.Reader to a websocket.
func MirrorWrite ¶
MirrorWrite is a uni-directional mirror which replicates a websocket to an io.Writer.
func NewWrapper ¶
func NewWrapper(conn *websocket.Conn) io.ReadWriteCloser
NewWrapper returns a new ReadWriteCloser wrapper for a websocket connection.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.