-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export wstest.Pipe for in memory tests #197
Comments
Not sure if this is a good idea anymore with #199 🤔 |
Any thoughts @coadler? |
// Pipe is used to create an in memory connection
// between two websockets analogous to net.Pipe.
func Pipe(dialOpts *websocket.DialOptions, acceptOpts *websocket.AcceptOptions) (clientConn, serverConn *websocket.Conn) {
// ...
} |
If I were to export it, I'd change the signature to: func Pipe() (http.RoundTripper, http.ResponseWriter) Any upgrade requests sent on the round tripper would wait for the given response writer to hijack and accept the WebSocket or otherwise respond. |
Not sure if this is a good idea anymore as |
Yea, going to close this for now. Only real problem is ensuring graceful shutdown in tests for which #209 is open. |
Would be really cool to have an in memory WebSocket implementation for tests versus starting a net/http test server every test.
The text was updated successfully, but these errors were encountered: