<filename>src/catcher/handlers/simple.py<gh_stars>1-10
'''
Created on 15 Sep 2017

@author: gavin
'''

from .basehandler import TcpHandler

class simple(TcpHandler):
    NAME = "Simple"
    DESCRIPTION = '''The most basic of handlers. Echos any data that is sent. Use this as a template or example.'''
    CONFIG = {
        'banner': 'Callback Catcher Online\r\n',
    }
    def __init__(self, *args):
        '''
        Constructor
        '''
        self.session = True
        TcpHandler.__init__(self, *args)
        
    def base_handle(self):
        """
        Simple echo handler
        """
        self.send_response(self.banner)
        
        while self.session is True:
            
            data = self.handle_request()
            if data:
                #MANIPULATE DATA HERE
                data = data
                
                #SEND DATA TO CLIENT
                self.send_response(data)
<filename>src/catcher/handlers/simple.py<gh_stars>1-10
'''
Created on 15 Sep 2017

@author: gavin
'''

from .basehandler import TcpHandler

class simple(TcpHandler):
    NAME = "Simple"
    DESCRIPTION = '''The most basic of handlers. Echos any data that is sent. Use this as a template or example.'''
    CONFIG = {
        'banner': 'Callback Catcher Online\r\n',
    }
    def __init__(self, *args):
        '''
        Constructor
        '''
        self.session = True
        TcpHandler.__init__(self, *args)
        
    def base_handle(self):
        """
        Simple echo handler
        """
        self.send_response(self.banner)
        
        while self.session is True:
            
            data = self.handle_request()
            if data:
                #MANIPULATE DATA HERE
                data = data
                
                #SEND DATA TO CLIENT
                self.send_response(data)
Created on 15 Sep 2017  @author: gavin The most basic of handlers. Echos any data that is sent. Use this as a template or example. Constructor Simple echo handler #MANIPULATE DATA HERE #SEND DATA TO CLIENT