This function gets called when the proxy starts up.
968690
def init(opts):
    '''
    
    '''
    if 'host' not in opts['proxy']:
        log.critical('No \'host\' key found in pillar for this proxy.')
        return False
    if 'username' not in opts['proxy']:
        log.critical('No \'username\' key found in pillar for this proxy.')
        return False
    if 'password' not in opts['proxy']:
        log.critical('No \'passwords\' key found in pillar for this proxy.')
        return False
    if 'auth' not in opts['proxy']:
        log.critical('No \'auth\' key found in pillar for this proxy.')
        return False

    DETAILS['url'] = 'https://{0}/json'.format(opts['proxy']['host'])
    DETAILS['headers'] = {'Content-Type': 'application/json-rpc'}

    # Set configuration details
    DETAILS['host'] = opts['proxy']['host']
    DETAILS['username'] = opts['proxy'].get('username')
    DETAILS['password'] = opts['proxy'].get('password')
    DETAILS['auth'] = opts['proxy'].get('auth')

    # Ensure connectivity to the device
    log.debug("Attempting to connect to bluecoat_sslv proxy host.")
    session, cookies, csrf_token = logon()
    log.debug("Successfully connected to bluecoat_sslv proxy host.")
    logout(session, cookies, csrf_token)

    DETAILS['initialized'] = True
207750
public function on_start()
    {
        $this->registerServiceProvider();
        $this->registerParsers();
        $this->app->make('director')->addSubscriber($this->app->make(EventSubscriber::class));
        if ($this->app->isRunThroughCommandLineInterface()) {
            $this->registerCLICommands();
        } else {
            $this->registerAssets();
            $this->registerRoutes();
        }
    }
858793
protected void loadMavenProxy() {
        if (null == settings) {
            return;
        }

        Proxy mvnProxy = settings.getActiveProxy();
        if (mvnProxy != null) {
            ProxyConfiguration newProxyConfiguration = new ProxyConfiguration();
            newProxyConfiguration.setHost(mvnProxy.getHost());
            newProxyConfiguration.setPort(mvnProxy.getPort());
            newProxyConfiguration.setUsername(mvnProxy.getUsername());
            newProxyConfiguration.setPassword(mvnProxy.getPassword());
            newProxyConfiguration.setHostExclusions(mvnProxy.getNonProxyHosts());
            proxyConfig = newProxyConfiguration;
            getLog().info("Maven proxy loaded successfully");
        } else {
            getLog().warn("No maven proxy found, however useMavenProxy is set to true!");
        }
    }
557330
def on_start(self, host, port, channel, nickname, password):
        
        self.client = WebSocketIRCClient(host, port, channel, nickname,
                                         password, self)
        self.spawn(self.client.start)
1031972
private void resetNextProxy(HttpUrl url, Proxy proxy) {
    if (proxy != null) {
      // If the user specifies a proxy, try that and only that.
      proxies = Collections.singletonList(proxy);
    } else {
      // Try each of the ProxySelector choices until one connection succeeds.
      List<Proxy> proxiesOrNull = address.proxySelector().select(url.uri());
      proxies = proxiesOrNull != null && !proxiesOrNull.isEmpty()
          ? Util.immutableList(proxiesOrNull)
          : Util.immutableList(Proxy.NO_PROXY);
    }
    nextProxyIndex = 0;
  }
1053859
public void serverCallStarted(ServerCallInfo<?, ?> callInfo) {
    for (StreamTracer tracer : tracers) {
      ((ServerStreamTracer) tracer).serverCallStarted(callInfo);
    }
  }
924522
def on_startup(self):
        

        LOGGER.debug("> Calling '{0}' Component Framework 'on_startup' method.".format(self.__class__.__name__))

        self.refresh_nodes.emit()
        return True
577223
function proxyVerifyCallback (fn, args, done) {
  const {callback, index} = findCallback(args);
  args[index] = function (err, user) {
    done(err, user, callback);
  };
  fn.apply(null, args);
}
397355
def on_start(self):
        
        LOGGER.debug("zeromq.Subscriber.on_start")
        try:
            self.zmqsocket.connect(self.zmqbind_url)
            self.zmqsocket.setsockopt_string(zmq.SUBSCRIBE, self.zmqtopic)
        except Exception as e:
            LOGGER.error("error while subscribing ! " + e.__cause__)
            raise e
        self.subscriber = threading.Thread(target=self.run, name=self.subscriber_name)
        self.subscriber.start()
1105831
function proxyEvent (emitter, event, optionalCallback) {
    emitter.on(event, function () {
      if (optionalCallback) {
        optionalCallback.apply(client, arguments)
      }
      client.emit(event)
    })
  }
19049
protected final void setHttpProxyHost(String proxyHost) {
        httpConf = new MyHttpClientConfiguration(proxyHost
                , httpConf.getHttpProxyUser()
                , httpConf.getHttpProxyPassword()
                , httpConf.getHttpProxyPort()
                , httpConf.isHttpProxySocks()
                , httpConf.getHttpConnectionTimeout()
                , httpConf.getHttpReadTimeout()
                , httpConf.isPrettyDebugEnabled(), httpConf.isGZIPEnabled()
        );
    }
488053
function setProxy($proxyHost, $proxyPort) {
      $this->useProxy = true;
      $this->proxyHost = $proxyHost;
      $this->proxyPort = $proxyPort;
    }
1328427
protected function onInit()
    {
        if (is_array($this->params)) {
            foreach ($this->params as $cName => $cMap) {
                $cFunc = Utility::get($cMap, "{func}");
                if (is_callable($cFunc)) {
                    $this->mapFuncs[$cName] = $cFunc;
                }

            }
        }

    }
708915
def start_proxy(self, port=None):
        

        self.runner.info_log("Starting proxy...")

        # Get a random port that is available
        if not port:
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            sock.bind(('0.0.0.0', 0))
            sock.listen(5)
            self.proxy_port = sock.getsockname()[1]
            sock.close()

        network_data_path = os.path.join(
            self.runner.runner_dir,
            'network_capture'
        )
        create_dir_if_doesnt_exist(network_data_path)

        self.proxy_output_path = os.path.join(
            network_data_path,
            string_to_filename('%s.data' % self.test_name)
        )

        path_to_mitmproxy = BROME_CONFIG['mitmproxy']['path']

        if not path_to_mitmproxy:
            raise Exception("""
                You need to set the mitmproxy:path config to be able
                to the use the proxy with this browser
            """)

        filter_ = BROME_CONFIG['mitmproxy']['filter']
        command = [
            path_to_mitmproxy,
            "-p",
            "%s" % self.proxy_port,
            "-w",
            self.proxy_output_path
        ]

        if filter_:
            command.append(filter_)

        process = self.execute_command(command)

        self.proxy_pid = process.pid

        self.runner.info_log("Proxy pid: %s" % self.proxy_pid)
591350
protected function onInit()
    {
        if (is_array($this->params)) {
            $this->override = Utility::get($this->params, "{override}", false);
        }

    }
372034
def on_startup(self):
        

        LOGGER.debug("> Calling '{0}' Component Framework 'on_startup' method.".format(self.__class__.__name__))

        if self.Autostart_TCP_Server_checkBox.isChecked():
            if not self.__tcp_server.online:
                self.__tcp_server.port = self.Port_spinBox.value()
                self.__tcp_server.start()
        return True
814805
def on_start(self):
        
        LOGGER.debug("rabbitmq.Service.on_start")
        self.connection = pika.BlockingConnection(self.parameters)
        self.channel = self.connection.channel()
        self.channel.queue_declare(queue=self.serviceQ, auto_delete=True)
        self.channel.basic_consume(self.on_request, self.serviceQ)
        self.service = threading.Thread(target=self.run, name=self.service_name)
        self.service.start()
        self.is_started = True