Update index.php

This commit is contained in:
Namhyeon Go 2024-02-20 11:00:47 +09:00 committed by GitHub
parent 475ade669f
commit 3a0da47dc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,12 +3,13 @@
// Namhyeon Go <abuse@catswords.net>
// https://github.com/gnh1201/caterpillar
// Created at: 2022-10-06
// Updated at: 2022-11-25
// Updated at: 2024-02-20
define("PHP_HTTPPROXY_VERSION", "0.1.4");
define("CATERPILLAR_PROXY_VERSION", "0.1.4");
define("PHP_HTTPPROXY_VERSION", CATERPILLAR_PROXY_VERSION);
if (strpos($_SERVER['HTTP_USER_AGENT'], "php-httpproxy/") !== 0) {
exit('<!DOCTYPE html><html><head><title>It works!</title><meta charset="utf-8"></head><body><h1>It works!</h1><p><a href="https://github.com/gnh1201/php-httpproxy">Download the client</a></p><hr><p>php-httpproxy/' . PHP_HTTPPROXY_VERSION . ' (Server; PHP ' . phpversion() . '; abuse@catswords.net)</p></body></html>');
if (strpos($_SERVER['HTTP_USER_AGENT'], "caterpillar-proxy/") !== 0 && strpos($_SERVER['HTTP_USER_AGENT'], "php-httpproxy/") !== 0) {
exit('<!DOCTYPE html><html><head><title>It works!</title><meta charset="utf-8"></head><body><h1>It works!</h1><p><a href="https://github.com/gnh1201/caterpillar">Download the client</a></p><hr><p>caterpillar-proxy/' . CATERPILLAR_PROXY_VERSION . ' (Server; PHP ' . phpversion() . '; abuse@catswords.net)</p></body></html>');
}
ini_set("default_socket_timeout", 1); // must be. because of `feof()` works