PHPackages                             asahasrabuddhe/dwaar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. asahasrabuddhe/dwaar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

asahasrabuddhe/dwaar
====================

SSH app server on Whisp with pluggable middleware, multiple apps, and session handling

00PHP

Since Mar 4Pushed 2mo agoCompare

[ Source](https://github.com/asahasrabuddhe/dwaar)[ Packagist](https://packagist.org/packages/asahasrabuddhe/dwaar)[ RSS](/packages/asahasrabuddhe-dwaar/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Dwaar
=====

[](#dwaar)

SSH app server on [Whisp](https://github.com/WhispPHP/whisp) with pluggable middleware, multiple apps, and session handling.

Features
--------

[](#features)

- **Session abstraction** – Wish-style `Session` over Whisp Connection + Channel: `user()`, `remoteAddr()`, `command()`, `pty()`, `writeToStdout` / `writeToStderr`, `exit()`.
- **Middleware pipeline** – Compose middlewares (first registered = outermost). Innermost handler starts the app.
- **Built-in middlewares**
    - **Recover** – Catch throwables in the chain or app, log and exit 1.
    - **Logging** – Log connect (user, remote, command, term, client version, public key) and disconnect with duration.
    - **AccessControl** – Restrict allowed exec commands; reject others with exit 1.
    - **Activeterm** – Require a PTY (interactive terminal); reject non-PTY with exit 1.
- **SessionOutput** – Helpers for session I/O: `print()` / `println()`, `error()` / `errorln()`, `fatal()` / `fatalln()`, `printf()` / `errorf()` / `fatalf()`.

Requirements
------------

[](#requirements)

- PHP 8.4+
- `ext-sockets`, `ext-pcntl`
- See [Whisp](https://github.com/WhispPHP/whisp) for additional runtime requirements.

Installation
------------

[](#installation)

```
composer require asahasrabuddhe/dwaar
```

Usage
-----

[](#usage)

Use `Dwaar\Server` instead of `Whisp\Server`, register middlewares and apps. Each connection runs the middleware stack before starting the app.

```
