!7 cm ProxyTest > DynPrintLogAndEnabled { transient autoDispose new L proxies; switchable int httpInPort = 8080; switchable int httpsInPort; switchable int httpOutPort = 8888; *() { enabled = false; } void startProxy(StandaloneHttpProxy proxy) ctex { proxy.forwardServerAndPort = req -> HostAndPort("localhost", httpOutPort); proxy.serveLocalhostOnly = true; proxy.rewriteHostHeader = false; proxies.add(proxy); proxy.start(); } start { if (!enabled) ret; if (httpInPort != 0) { new StandaloneHttpProxy proxy; proxy.port = httpInPort; startProxy(proxy); } if (httpsInPort != 0) { new StandaloneHttpProxy proxy; var serverSocketFactory = serverSocketFactory_botCompanyEtc(); proxy.port = httpsInPort; proxy.makeServerSocket = -> ctex { ret serverSocketFactory.createServerSocket(proxy.port); }; startProxy(proxy); } } }