20 lines
428 B
Python
20 lines
428 B
Python
|
|
||
|
def is_http(header_bytes: bytes) -> bool:
|
||
|
"""
|
||
|
Returns True if the header is an HTTP request.
|
||
|
"""
|
||
|
|
||
|
def is_ssh(header_bytes: bytes) -> bool:
|
||
|
"""
|
||
|
Returns True if the header is an SSH request.
|
||
|
"""
|
||
|
|
||
|
def write(fd: int, header_bytes: bytes) -> int:
|
||
|
"""
|
||
|
Sends data chunked to the client.
|
||
|
"""
|
||
|
|
||
|
def read(fd: int, length: int) -> bytes:
|
||
|
"""
|
||
|
Read n bytes from the client. Will not block.
|
||
|
"""
|