#!/usr/bin/env python
# -*- coding: utf-8 -*-

import asyncio
import logging
import concurrent.futures


class EchoServer(object):
    """Echo server class"""

    def __init__(self, host, port, loop=None):
        self._loop = loop or asyncio.get_event_loop()
        self._server = asyncio.start_server(self.handle_connection, host=host, port=port)

    def start(self, and_loop=True):
        self._server = self._loop.run_until_complete(self._server)
        logging.info('Listening established on {0}'.format(self._server.sockets[0].getsockname()))
        if and_loop:
            self._loop.run_forever()

    def stop(self, and_loop=True):
        self._server.close()
        if and_loop:
            self._loop.close()

    @asyncio.coroutine
    def handle_connection(self, reader, writer):
        peername = writer.get_extra_info('peername')
        logging.info('Accepted connection from {}'.format(peername))
        while not reader.at_eof():
            try:
                line = yield from asyncio.wait_for(reader.readline(), timeout=10.0)
                logging.debug('Recived data: {}'.format(line))
                if not line.strip():
                    break
            except concurrent.futures.TimeoutError:
                logging.error('Conection Timeout')
                break

        writer.write(b'{"OK":1}')
        logging.info('Closing connection')
        writer.close()


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)
    server = EchoServer('0.0.0.0', 16030)
    try:
        server.start()
    except KeyboardInterrupt:
        pass  # Press Ctrl+C to stop
    finally:
        server.stop()

@@ -913,24 +913,72 @@
 (peername))%0A
+        host = False%0A        get_params = False%0A
         whil
@@ -1033,19 +1033,23 @@
         
-lin
+respons
 e = yiel
@@ -1126,54 +1126,223 @@
    l
-ogging.debug('Recived data: %7B%7D'.format(line))%0A
+ine = response.decode().strip()%0A                split_line = line.split()%0A                if split_line:%0A                    if split_line%5B0%5D.lower() == 'get':%0A                        get_params = split_line%5B1%5D%0A    
     
@@ -1357,213 +1357,493 @@
     
+el
 if 
-not line.strip():%0A                    break%0A            except concurrent.futures.TimeoutError:%0A                logging.error('Conection Timeout')%0A                break%0A%0A        writer.write(b'%7B%22OK%22:1%7D'
+split_line%5B0%5D.lower() == 'host:':%0A                        host = split_line%5B1%5D.split(':')%5B0%5D%0A                if not line:%0A                    break%0A                logging.debug('Recived data: %7B%7D'.format(line))%0A            except concurrent.futures.TimeoutError:%0A                logging.error('Conection Timeout')%0A                break%0A        logging.info('Accepted command from %7B%7D: %7B%7D'.format(host, get_params))%0A        writer.write(b'%7B%22OK%22:1%7D')%0A        yield from writer.drain(
 )%0A  

Add parsing host and getparam