A websocket client for unit-testing a websocket server
The gorilla organization provides full featured websocket implementation that the standard library lacks.
The standard library provides a httptest.ResponseRecorder
struct that test
an http.Handler
without ListenAndServe
, but is helpless when the connection is being hijacked
by an http upgrader.
This package provides a client to test just the http.Handler
that uses an hijacker to hijack
the connection and start a websocket session, without starting the server.
go get -u github.com/posener/wstest
See the example.