diff --git a/demo/views/frontend.py b/demo/views/frontend.py index 5b4d6e8..7919dc0 100644 --- a/demo/views/frontend.py +++ b/demo/views/frontend.py @@ -21,19 +21,12 @@ async def websocket_handler(request): await ws.prepare(request) asyncio.create_task(secondary_functions.time_response(ws, delay=60)) async for msg in ws: - if msg.type == aiohttp.WSMsgType.TEXT: - - if msg.data == 'close': - await ws.close() - else: - await ws.send_str(f'Вы ввели: {msg.data}') + await ws.send_str(f'Вы ввели: {msg.data}') elif msg.type == WSMsgType.ERROR: print('ws connection closed with exception %s' % ws.exception()) - print('websocket connection closed') - return ws diff --git a/entry.py b/entry.py index 0160f5f..73db430 100644 --- a/entry.py +++ b/entry.py @@ -6,4 +6,4 @@ app = create_app() if __name__ == '__main__': aiohttp.web.run_app(app) -# Добавить 2 страничку, подключить ws, отправлял текущие время раз в минуту. Ну и также отвечать на собщения. +