A non-blocking TCP networking library for PocketMine-MP
- SobanaHttp - Example Sobana HTTP server
- Creating Server
$server = Sobana::createServer("0.0.0.0", 8080, MySession::class);
$server->start();
- Creating Session
class MySession extends ServerSession{
public function handlePacket(string $packet): void{
$this->write("HTTP/1.1 200 OK\r\nContent-Length: 11\r\n\r\nHello World");
$this->close();
}
}
- Creating Encoder/Decoder
See example plugin