#!/usr/bin/env python3
# coding: utf-8

import asyncio
# import logging
from aiohttp import web
from port_scanner import scan

# log = logging.getLogger(__name__)



async def port_scan(request):
    logger      = request.app['logger']
    ip          = str(request.match_info['ip'])
    begin_port  = int(request.match_info['begin_port'])
    end_port    = int(request.match_info['end_port'])

    # print (request.__dir__())

    logger.info(f'Сканируем IP:{ip}, порты с {begin_port} по {end_port}')

    data, ports_count = await scan(ip, begin_port, end_port)

    logger.info(f'Просканировано {ports_count} портов')



    return web.json_response(data)

1b79f3865bfe7e9cd944178d4ec1e4134df59d0a
<mask token>

<mask token>


async def port_scan(request):
    logger = request.app['logger']
    ip = str(request.match_info['ip'])
    begin_port = int(request.match_info['begin_port'])
    end_port = int(request.match_info['end_port'])
    logger.info(f'Сканируем IP:{ip}, порты с {begin_port} по {end_port}')
    data, ports_count = await scan(ip, begin_port, end_port)
    logger.info(f'Просканировано {ports_count} портов')
    return web.json_response(data)

import asyncio
from aiohttp import web
from port_scanner import scan


async def port_scan(request):
    logger = request.app['logger']
    ip = str(request.match_info['ip'])
    begin_port = int(request.match_info['begin_port'])
    end_port = int(request.match_info['end_port'])
    logger.info(f'Сканируем IP:{ip}, порты с {begin_port} по {end_port}')
    data, ports_count = await scan(ip, begin_port, end_port)
    logger.info(f'Просканировано {ports_count} портов')
    return web.json_response(data)

#!/usr/bin/env python3
# coding: utf-8

import asyncio
# import logging
from aiohttp import web
from port_scanner import scan

# log = logging.getLogger(__name__)



async def port_scan(request):
    logger      = request.app['logger']
    ip          = str(request.match_info['ip'])
    begin_port  = int(request.match_info['begin_port'])
    end_port    = int(request.match_info['end_port'])

    # print (request.__dir__())

    logger.info(f'Сканируем IP:{ip}, порты с {begin_port} по {end_port}')

    data, ports_count = await scan(ip, begin_port, end_port)

    logger.info(f'Просканировано {ports_count} портов')



    return web.json_response(data)
