Пример #1
0
/* System stuff
 */
require "config.php";
require "system.php";
if (substr($_CONFIG["proxy_hostname"], 0, 2) == "*.") {
    exit("Incorrect proxy_hostname set in config.php.");
}
session_name(SESSION_KEY);
session_set_cookie_params(0, "/", "." . $_CONFIG["proxy_basename"]);
session_start();
unset($_COOKIE[SESSION_KEY]);
/* Bootstrap
 */
$bootstrap = new bootstrap($_CONFIG);
$result = $bootstrap->execute();
if ($result == 0) {
    /* Start proxy
     */
    if ($_SERVER["HTTPS"] == "on") {
        $proxy = new proxys($_CONFIG, $bootstrap->hostname, $_SERVER["SERVER_PORT"]);
    } else {
        $proxy = new proxy($_CONFIG, $bootstrap->hostname, $_SERVER["SERVER_PORT"]);
    }
    /* Other proxy
     */
    if ($_CONFIG["forwarding_proxy"] != null) {
        list($protocol, $hostname, $port) = explode(":", $_CONFIG["forwarding_proxy"], 3);
        $hostname = trim($hostname, "/");
        $port = trim($port, "/");
        if ($hostname != "" && $port != "") {