Initial commit

This commit is contained in:
Christopher Vagnetoft
2026-04-02 22:29:35 +02:00
commit 62a1167055
31 changed files with 3759 additions and 0 deletions

35
doc/text-protos.md Normal file
View File

@@ -0,0 +1,35 @@
# Text/Line Protocols
## Available sub-protocols
### HttpLikeProtocol
This is as the name says a HTTP-like parser. It can be used for HTTP, STOMP
and more. All messages are expected to follow the following style:
```text
query-line <$lineSeparator>
header-line* <$lineSeparator>
<$lineSeparator>
optional-body
```
Line separators default to `\n`, but can be set to any sequence or the value `true`
to attempt to automatically detect the endings used.
The presence of a body is determined by consulting the headers. The `$contentLengthHeader`
constructor parameter defaults to 'content-length', and can be set to null to disable parsing
of bodies entirely.
```php
$proto = new HttpLikeProtocol(
queryFormat: '{command} {path}',
lineSeparator: true,
)
```