Пример #1
0
from functools import partial
try:
    from pulsar.apps import http
except ImportError:
    import sys
    sys.path.append('../../')
    from pulsar.apps import http

from pulsar.utils.log import configure_logging

HOME_URL = 'https://127.0.0.1:8060/'

configure_logging(level='debug')
proxy_info = {
    'http': 'http://127.0.0.1:9080',
    'https': 'http://127.0.0.1:9080'
}


def data_received(response, data=None):
    print('DATA RECEIVED')
    print(response.request)
    print('%s' % data)
    print('---------------------------------------------------')
    print('')


def pre_request(response):
    connection = response.connection
    print('PRE REQUEST ON CONNECTION %s' % connection)
    print(response.request)
Пример #2
0
try:
    from pulsar.apps import http
except ImportError:
    import sys
    sys.path.append('../../')
    from pulsar.apps import http

from pulsar.utils.log import configure_logging

HOME_URL = 'https://127.0.0.1:8060/'

configure_logging(level='debug')
proxy_info = {'http': 'http://127.0.0.1:9080',
              'https': 'http://127.0.0.1:9080'}


def data_received(response, data=None):
    print('DATA RECEIVED')
    print(response.request)
    print('%s' % data)
    print('---------------------------------------------------')
    print('')


def pre_request(response):
    connection = response.connection
    print('PRE REQUEST ON CONNECTION %s' % connection)
    print(response.request)
    print('---------------------------------------------------')
    print('')