async-asgi-testclient icon indicating copy to clipboard operation
async-asgi-testclient copied to clipboard

Cannot use `wss://` as the scheme for WebSocket tests

Open shevron opened this issue 3 years ago • 0 comments

I'm testing an app that needs to know whether a WebSocket connection was done over ws:// or wss://. Currently, while I can override the scheme for HTTP requests, I cannot set the scheme used for WebSocket connections. Moreover, overriding this behavior via subclassing for example is quite difficult as the scheme is hard-coded inside the WebSocketSession.connect() method which is quite extensive.

It would be helpful if I could override the WS connection scheme and set it to wss:// or ws:// explicitly.

shevron avatar Dec 27 '21 16:12 shevron