Files

34 lines
569 B
PHP
Raw Permalink Normal View History

2026-04-04 10:29:39 +08:00
<?php
namespace Coroutine\Server;
class Config
{
2026-04-17 14:41:13 +08:00
public string $host = '0.0.0.0';
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public int $port = 9501;
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public string $authKey = 'access_token';
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public int $writeTimeout = 0;
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public int $maxCoroutine = 100000;
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public int $readTimeout = 0;
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public int $maxPackageSize = 2097152;
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public int $maxFrameSize = 2097152;
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public bool $exposeOnlineLists = false;
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public string $websocketPath = '/websocket';
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public string $onlineListPath = '/online/lists';
2026-04-04 10:29:39 +08:00
2026-04-17 14:41:13 +08:00
public function normalizePath(string $path): string
{
return '/' . ltrim($path, '/');
2026-04-04 10:29:39 +08:00
}
}