mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-07-12 23:43:11 +00:00
Compare commits
3 Commits
6587e4a39e
...
c407739e12
Author | SHA1 | Date | |
---|---|---|---|
c407739e12 | |||
607c6b00c1 | |||
acf661db24 |
|
@ -6,10 +6,10 @@
|
|||
* Namhyeon Go (Catswords Research) <abuse@catswords.net>
|
||||
* https://github.com/gnh1201/caterpillar
|
||||
* Created at: 2022-10-06
|
||||
* Updated at: 2024-06-21
|
||||
* Updated at: 2024-06-25
|
||||
*/
|
||||
|
||||
define("PHP_HTTPPROXY_VERSION", "0.1.5.21");
|
||||
define("PHP_HTTPPROXY_VERSION", "0.1.5.22");
|
||||
define("DEFAULT_SOCKET_TIMEOUT", 1);
|
||||
define("STATEFUL_SOCKET_TIMEOUT", 30);
|
||||
define("MAX_EXECUTION_TIME", 0);
|
||||
|
@ -220,8 +220,8 @@ function relay_mysql_connect($params) {
|
|||
$hostname = $params['hostname'];
|
||||
$username = $params['username'];
|
||||
$password = $params['password'];
|
||||
$database = $params['database'];
|
||||
$port = array_key_exists('port', $params) ? intval($params['port']) : null;
|
||||
$database = array_key_exists('database', $params) ? $params['database'] : null;
|
||||
$port = array_key_exists('port', $params) ? intval($params['port']) : 3306;
|
||||
$charset = array_key_exists('charset', $params) ? $params['charset'] : "utf8";
|
||||
|
||||
try {
|
||||
|
@ -285,18 +285,19 @@ function relay_mysql_query($params, $mysqli) {
|
|||
"status" => 200
|
||||
);
|
||||
switch($query_type) {
|
||||
case "show":
|
||||
case "select":
|
||||
$success = true;
|
||||
$result['data'] = mysqli_fetch_all($query_result, MYSQLI_ASSOC);
|
||||
break;
|
||||
|
||||
case "insert":
|
||||
$success = $query_result;
|
||||
$success = (bool) $query_result;
|
||||
$result['last_id'] = @$mysqli->insert_id();
|
||||
break;
|
||||
|
||||
default:
|
||||
$success = $query_result;
|
||||
$success = (bool) $query_result;
|
||||
}
|
||||
|
||||
return array(
|
||||
|
|
32
console.html
32
console.html
|
@ -5,11 +5,37 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.42.0/css/jquery.terminal.min.css" rel="stylesheet"/>
|
||||
<style type="text/css">/*<!--<![CDATA[*/
|
||||
body {
|
||||
background: #2e8d36 url(https://pub-1a7a176eea68479cb5423e44273657ad.r2.dev/bg.jpg) no-repeat;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
}
|
||||
h1, p {
|
||||
color: #093923;
|
||||
}
|
||||
p a {
|
||||
color: #fff;
|
||||
padding: 0 2px;
|
||||
text-decoration: none;
|
||||
border-bottom: 2px solid #fff;
|
||||
}
|
||||
main {
|
||||
width: 640px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.terminal, .cmd {
|
||||
background: #093923;
|
||||
}
|
||||
/*]]>-->*/</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Caterpillar Proxy Web Console</h1>
|
||||
<div id="console"></div>
|
||||
<p><a href="https://github.com/gnh1201/caterpillar">Fork me. gnh1201/caterpillar (GitHub)</a></p>
|
||||
<main>
|
||||
<h1>Caterpillar Proxy Web Console</h1>
|
||||
<p>Download an worker script of <a href="https://github.com/gnh1201/caterpillar">Caterpillar Proxy</a>.</p>
|
||||
<div id="console"></div>
|
||||
<p><a href="https://github.com/gnh1201/caterpillar">Fork me. gnh1201/caterpillar (GitHub)</a></p>
|
||||
</main>
|
||||
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.42.0/js/jquery.terminal.min.js"></script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user