Activates a proxy override for the given URI scheme.
482531
public void activate(InetAddress host, int port, Collection<String> nonProxyHosts) {
        for (String scheme : new String[] {"http", "https"}) {
            String currentProxyHost = System.getProperty(scheme + ".proxyHost");
            String currentProxyPort = System.getProperty(scheme + ".proxyPort");
            if (currentProxyHost != null) {
                originalProxies.put(scheme, new InetSocketAddress(currentProxyHost, Integer.parseInt(currentProxyPort)));
            }
            System.setProperty(scheme + ".proxyHost", new InetSocketAddress(host, port).getHostString());
            System.setProperty(scheme + ".proxyPort", Integer.toString(port));
        }

        String currentNonProxyHosts = System.getProperty("http.nonProxyHosts");
        if (currentNonProxyHosts == null) {
            originalNonProxyHosts.clear();
        } else {
            for (String nonProxyHost : Splitter.on('|').split(currentNonProxyHosts)) {
                originalNonProxyHosts.add(nonProxyHost);
            }
        }
        System.setProperty("http.nonProxyHosts", Joiner.on('|').join(nonProxyHosts));
    }
1080340
def register(self, alias, uri):
        
        # TODO: do we want to constrain the valid alias names.
        if isinstance(uri, dict):
            id = uri.get('id', alias)
            self.resolver.store[id] = uri
            uri = id
        self.aliases[alias] = uri
1043194
public void setURI(String uri) {
		try {
			this.value = (uri != null) ? new URI(uri) : null;
		} catch (Throwable exception) {
			this.value = null;
		}
		this.type = AttributeType.URI;
		this.assigned = this.value != null;
	}
569451
public <T> T proxy(final T src, Class<T> tClass) {
        return callbackExtension.proxy(src, tClass);
    }
244327
@Override
    public void activate() throws InterruptedException, CouldNotPerformException {
        synchronized (maintainerLock) {

            // Duplicated activation filter.
            if (isActive()) {
                return;
            }

            try {
                verifyMaintainability();
                validateInitialization();
                setConnectionState(CONNECTING);
                remoteServerWatchDog.activate();
                listenerWatchDog.activate();
            } catch (CouldNotPerformException ex) {
                throw new InvalidStateException("Could not activate remote service!", ex);
            }
        }
    }
474282
def register(self, extension, extension_name):
        
        self._extensions[extension_name] = extension
        self.ROUTES.extend([
            tuple(list(t) + [extension_name])
            for t in extension.ROUTES
        ])
        self.CACHED.extend([
            (f_name, extension_name)
            for f_name in extension.CACHED
        ])

        # This order allows for user defaults to overwrite extension ones
        self.Access_Control_Allow_Methods.update({
            k: v
            for k, v in extension.Access_Control_Allow_Methods.items()
            if k not in self.Access_Control_Allow_Methods
        })
398025
def construct(self, uri, *args, **kw):
        
        logger.debug(util.lazy_format("Constructing {0}", uri))
        if ('override' not in kw or kw['override'] is False) \
                and uri in self.resolved:
            logger.debug(util.lazy_format("Using existing {0}", uri))
            return self.resolved[uri]
        else:
            ret = self._construct(uri, *args, **kw)
        logger.debug(util.lazy_format("Constructed {0}", ret))

        return ret
385057
def perform
      uri = URI(url)
      response = Net::HTTP.start(uri.hostname, uri.port,
        :use_ssl => uri.scheme == 'https' ) { |http|
        Orchestrate.config.logger.debug "Performing #{method.to_s.upcase} request to \"#{url}\""
        http.request(request(uri))
      }
      Response.new(response)
    end
520355
private static void applyOverrides() {
        // Get the appropriate InputStream to read overrides from, if any.
        InputStream stream = getContentTypesPropertiesStream();
        if (stream == null) {
            return;
        }

        try {
            try {
                // Read the properties file...
                Properties overrides = new Properties();
                overrides.load(stream);
                // And translate its mapping to ours...
                for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
                    String extension = (String) entry.getKey();
                    String mimeType = (String) entry.getValue();
                    add(mimeType, extension);
                }
            } finally {
                stream.close();
            }
        } catch (IOException ignored) {
        }
    }
1332734
def register(scheme):
    
    scheme = nstr(scheme)
    urlparse.uses_fragment.append(scheme)
    urlparse.uses_netloc.append(scheme)
    urlparse.uses_params.append(scheme)
    urlparse.uses_query.append(scheme)
    urlparse.uses_relative.append(scheme)
864317
def activate(request, activation_key=None):
    
    utils.activate_user(activation_key)
    # if not activated
    success_url = utils.get_settings('REGISTRATION_API_ACTIVATION_SUCCESS_URL')
    if success_url is not None:
        return HttpResponseRedirect(success_url)
903363
void activateClassAvailableProxyTarget() throws Exception {
        Method method = ReflectionHelper.getDeclaredMethod(getClass(), "classAvailable", Class.class);
        findClassAvailableProxySetClassAvailableTargetMethod().invoke(null, this, method);
    }
637604
@InternalFunction(precedence=1,isAssign=true)
    public void activate(RuleContext ruleContext,RuleProxyField ruleProxyField)
    {
        setActivate(ruleProxyField,ruleContext);
    }
1007136
function getProxyMiddleware(context, uri) {
  const pathRewrite = {};
  pathRewrite[`^${context}`] = url.parse(uri).pathname;

  return proxy({
    target: getHost(uri),
    changeOrigin: true,
    logLevel: 'warn',
    pathRewrite: pathRewrite,
  });
}
1171907
public IpcLogEntry withUri(String uri, String path) {
    this.uri = uri;
    this.path = path;
    return this;
  }
1008971
public URI rewriteURI(RequestContext rc) throws URISyntaxException {
        Request request = rc.request();
        String path = request.path();
        if (!path.startsWith(prefix)) {
            return null;
        }

        return computeDestinationURI(request, path, proxyTo, prefix);
    }
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