public MockResponse withWebSocketUpgrade ( WebSocketListener listener ) { setStatus ( "HTTP/1.1 101 Switching Protocols" ) ; setHeader ( "Connection" , "Upgrade" ) ; setHeader ( "Upgrade" , "websocket" ) ; body = null ; webSocketListener = listener ; return this ; }
Attempts to perform a web socket upgrade on the connection . This will overwrite any previously set status or body .