def start_ctx_proxy(ctx, process): ctx_proxy_type = process.get('ctx_proxy_type') if not ctx_proxy_type or ctx_proxy_type in ('auto', 'http'): return HTTPCtxProxy(ctx) elif ctx_proxy_type == 'none': return StubCtxProxy() else: raise NonRecoverableError( 'Unsupported proxy type: {0}'.format(ctx_proxy_type))
def start_ctx_proxy(ctx, process): ctx_proxy_type = process.get('ctx_proxy_type') if not ctx_proxy_type or ctx_proxy_type == 'auto': if HAS_ZMQ: if IS_WINDOWS: return TCPCtxProxy(ctx) else: return UnixCtxProxy(ctx) else: return HTTPCtxProxy(ctx) elif ctx_proxy_type == 'unix': return UnixCtxProxy(ctx) elif ctx_proxy_type == 'tcp': return TCPCtxProxy(ctx) elif ctx_proxy_type == 'http': return HTTPCtxProxy(ctx) elif ctx_proxy_type == 'none': return StubCtxProxy() else: raise NonRecoverableError( 'Unsupported proxy type: {0}'.format(ctx_proxy_type))