aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol2/reverse_proxy.py
blob: 3ca998d50c8bb2d7687a8b2c49300a8ead75c7bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from __future__ import (absolute_import, print_function, division)

from .layer import Layer, ServerConnectionMixin


class ReverseProxy(Layer, ServerConnectionMixin):
    def __init__(self, ctx, server_address, server_tls):
        super(ReverseProxy, self).__init__(ctx, server_address=server_address)
        self.server_tls = server_tls

    def __call__(self):
        layer = self.ctx.next_layer(self)
        try:
            layer()
        finally:
            if self.server_conn:
                self._disconnect()