forked from bootgly/bootgly
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.http.php
More file actions
55 lines (40 loc) · 1.31 KB
/
Copy pathserver.http.php
File metadata and controls
55 lines (40 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/*
* --------------------------------------------------------------------------
* Bootgly PHP Framework
* Developed by Rodrigo Vieira (@rodrigoslayertech)
* Copyright 2020-present
* Licensed under MIT
* --------------------------------------------------------------------------
*/
namespace Bootgly;
require_once '@/autoload.php';
use Bootgly\CLI\HTTP;
$HTTPServer = new HTTP\Server;
$HTTPServer->configure(
host: '0.0.0.0',
port: 8080,
workers: round( ((int) shell_exec('nproc')) * 0.50 ), // Without JIT: * 0.6
/*
ssl: [
// SSL Certificate
'local_cert' => __DIR__ . '/@/certificates/localhost.cert.pem',
// SSL Keyfile
'local_pk' => __DIR__ . '/@/certificates/localhost.key.pem',
'disable_compression' => true, // TLS compression attack vulnerability
'ssltransport' => 'tlsv1.3',
'ciphers' => 'AES256-SHA256',
'verify_peer' => false,
#'verify_peer_name' => true,
#'capture_peer_cert' => true,
]
*/
);
// on Data -> projects/sapi.http.constructor.php
$HTTPServer->start();
// Benchmark test suggestion with 512 connections:
// eg. if your CPU have 24 CPU cores:
// # Without JIT enabled: ~40% of CPU
// wrk -t10 -c514 -d10s http://localhost:8080
// # With JIT enabled: ~50% of CPU
// wrk -t12 -c514 -d10s http://localhost:8080