diff --git a/sanic/request.py b/sanic/request.py index 68743c79..c8f14ca0 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -142,6 +142,10 @@ class Request(dict): @property def scheme(self): + if self.app.websocket_enabled \ + and self.headers.get('upgrade') == 'websocket': + return 'ws' + if self.transport.get_extra_info('sslcontext'): return 'https'