Construct a client-side proxy object that implements the named protocol,
talking to a server at the named address.
513207
public static <V extends VersionedProtocol> V getProxy(Class<V> protocol, InetSocketAddress addr,
			SocketFactory factory) throws IOException {

		@SuppressWarnings("unchecked")
		V proxy = (V) Proxy.newProxyInstance(protocol.getClassLoader(), new Class[] { protocol }, new Invoker(addr, factory));

		return proxy;
	}
1211384
def new_contract_proxy(self, contract_interface, contract_address: Address):
        
        return ContractProxy(
            self,
            contract=self.new_contract(contract_interface, contract_address),
        )
786113
def http_proxy(addr = nil, port = nil, user = nil, pass = nil)
      default_options[:http_proxyaddr] = addr
      default_options[:http_proxyport] = port
      default_options[:http_proxyuser] = user
      default_options[:http_proxypass] = pass
    end
620081
def add_proxy_meth(cls, name, func, arg_pos=0):
        

        @wraps(func)
        def proxied(self, *args, **kwargs):
            args = list(args)
            args.insert(arg_pos, self.__subject__)
            result = func(*args, **kwargs)
            return result

        setattr(cls, name, proxied)
817149
function setupProxyProperty(name, opt_setPropsValue) {
    Object.defineProperty(ProxyXMLHttpRequest.prototype, name, {
      'configurable': true,
      'enumerable': true,
      'get': function() {
        return this.handle_[name];
      },
      'set': opt_setPropsValue ? function(value) {
        this.props_[name] = value;
        this.handle_[name] = value;
      } : function(value) {
        this.handle_[name] = value;
      }
    });
  }
1107934
def build_http(host, port)
      params = [host, port]
      params += @proxy_options.values_at(:host, :port, :user, :pass) unless @proxy_options.empty?
      add_ssl(Net::HTTP.new(*params))
    end
459722
function insertProxy(proxies, namespace, serverType, proxy) {
    proxies[namespace] = proxies[namespace] || {};
    if (proxies[namespace][serverType]) {
        for (const attr in proxy) {
            if (proxy.hasOwnProperty(attr)) {
                proxies[namespace][serverType][attr] = proxy[attr];
            }
        }
    } else proxies[namespace][serverType] = proxy;
}
1323725
private void configureProxyServer(ChannelPipeline clientPipeline) {
        if (proxyServerConfiguration != null && sslConfig != null) {
            if (proxyServerConfiguration.getProxyUsername() != null
                    && proxyServerConfiguration.getProxyPassword() != null) {
                clientPipeline.addLast(Constants.PROXY_HANDLER,
                        new HttpProxyHandler(proxyServerConfiguration.getInetSocketAddress(),
                                proxyServerConfiguration.getProxyUsername(),
                                proxyServerConfiguration.getProxyPassword()));
            } else {
                clientPipeline.addLast(Constants.PROXY_HANDLER,
                        new HttpProxyHandler(proxyServerConfiguration.getInetSocketAddress()));
            }
        }
    }
106312
def connection_made(self, address):
        """"""
        self._proxy = PickleProxy(self.loop, self)
        for d in self._proxy_deferreds:
            d.callback(self._proxy)
576480
def use_proxy(uri, port, user=nil, pass=nil)
      @http_class = Net::HTTP::Proxy(uri, port, user, pass)
    end
749981
def proxy(ctx, bind, port):
    
    app = web.Application()
    app.on_startup.append(startup_proxy)
    app.on_cleanup.append(cleanup_proxy)

    app.router.add_route("GET", r'/stream/{path:.*$}', websocket_handler)
    app.router.add_route("GET", r'/wsproxy/{path:.*$}', websocket_handler)
    app.router.add_route('*', r'/{path:.*$}', web_handler)
    if getattr(ctx.args, 'testing', False):
        return app
    web.run_app(app, host=bind, port=port)
889807
def setProxy(self, protocol="http"):
        
        # Setting proxy
        try:
            new = { protocol: self.proxies[protocol]}
            self.br.set_proxies( new )
        except:
            # No proxy defined for that protocol
            pass
1175897
private static InetSocketAddress overrideProxy(String proxyHostPort) {
    if (proxyHostPort == null) {
      return null;
    }

    String[] parts = proxyHostPort.split(":", 2);
    int port = 80;
    if (parts.length > 1) {
      port = Integer.parseInt(parts[1]);
    }
    log.warning(
        "Detected GRPC_PROXY_EXP and will honor it, but this feature will "
            + "be removed in a future release. Use the JVM flags "
            + "\"-Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT\" to set the https proxy for "
            + "this JVM.");
    return new InetSocketAddress(parts[0], port);
  }
1152933
public static ProtocolNegotiator serverPlaintext() {
    return new ProtocolNegotiator() {
      @Override
      public ChannelHandler newHandler(final GrpcHttp2ConnectionHandler handler) {
        class PlaintextHandler extends ChannelHandlerAdapter {
          @Override
          public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
            // Set sttributes before replace to be sure we pass it before accepting any requests.
            handler.handleProtocolNegotiationCompleted(Attributes.newBuilder()
                .set(Grpc.TRANSPORT_ATTR_REMOTE_ADDR, ctx.channel().remoteAddress())
                .set(Grpc.TRANSPORT_ATTR_LOCAL_ADDR, ctx.channel().localAddress())
                .build(),
                /*securityInfo=*/ null);
            // Just replace this handler with the gRPC handler.
            ctx.pipeline().replace(this, null, handler);
          }
        }

        return new PlaintextHandler();
      }

      @Override
      public void close() {}

      @Override
      public AsciiString scheme() {
        return Utils.HTTP;
      }
    };
  }
507643
function proxyRequest(data, next) {

        debug('proxying %s %s', data.clientRequest.method, data.url);

        var middlewareHandledRequest = _.some(config.requestMiddleware, function(middleware) {
            middleware(data);
            return data.clientResponse.headersSent; // if true, then _.some will stop processing middleware here because we can no longer
        });

        if (!middlewareHandledRequest) {
            var uri = URL.parse(data.url);

            var options = {
                host: uri.hostname,
                port: uri.port,
                path: uri.path,
                method: data.clientRequest.method,
                headers: data.headers
            };

            //set the agent for the request.
            if(uri.protocol == 'http:' && config.httpAgent) {
              options.agent =  config.httpAgent;
            }
            if(uri.protocol == 'https:' && config.httpsAgent) {
              options.agent =  config.httpsAgent;
            }

            // what protocol to use for outgoing connections.
            var proto = (uri.protocol == 'https:') ? https : http;

            debug('sending remote request: ', options);

            data.remoteRequest = proto.request(options, function(remoteResponse) {
                data.remoteResponse = remoteResponse;
                data.remoteResponse.on('error', next);
                proxyResponse(data);
            });

            data.remoteRequest.on('error', next);

            // pass along POST data & let the remote server know when we're done sending data
            data.stream.pipe(data.remoteRequest);
        }

    }
1351169
def serve(name: str = "", port: int = 5000) -> None:
    
    logging.info(" * Listening on port %s", port)
    httpd = HTTPServer((name, port), RequestHandler)
    httpd.serve_forever()
1005544
def buildProtocol(self, addr):
        
        self.resetDelay()
        self.client = self.protocol(self._parameters)
        self.client.factory = self
        self.client.ready.addCallback(lambda _: self._on_client_ready())
        return self.client