Update index.php, server.py

This commit is contained in:
Namhyeon Go 2022-11-25 21:37:34 +09:00
parent b5b57f5012
commit 0d3d20b535
2 changed files with 4 additions and 2 deletions

View File

@ -4,8 +4,10 @@
// Created at: 2022-10-06
// Updated at: 2022-11-25
define("PHP_HTTPPROXY_VERSION", "0.1.3");
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>Version: 0.1.3</p></body></html>');
exit('<!DOCTYPE html><html><head><title>It works!</title><meta charset="utf-8"></head><body><h1>It works!</h1><p>Version: ' . PHP_HTTPPROXY_VERSION . '</p></body></html>');
}
ini_set("default_socket_timeout", 1); // must be. because of `feof()` works

View File

@ -138,7 +138,7 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
proxy_data = {
'headers': {
"User-Agent": "php-httpproxy/0.1.3 (Client; Python " + python_version() + "); abuse@catswords.com",
"User-Agent": "php-httpproxy/0.1.3 (Client; Python " + python_version() + "; abuse@catswords.net)",
},
'data': {
"data": base64.b64encode(data).decode(client_encoding),