Initial commit
This commit is contained in:
35
doc/text-protos.md
Normal file
35
doc/text-protos.md
Normal 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,
|
||||
)
|
||||
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user