PHPackages                             rollylni/rcon-protocol - 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. rollylni/rcon-protocol

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

rollylni/rcon-protocol
======================

the library is written based on the Source RCON Protocol

0.1.0(5y ago)19MITPHPPHP &gt;=7.1

Since Apr 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Rollylni/RconProtocol)[ Packagist](https://packagist.org/packages/rollylni/rcon-protocol)[ RSS](/packages/rollylni-rcon-protocol/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

RconProtocol
============

[](#rconprotocol)

[![PHPVersion](https://camo.githubusercontent.com/d360865b5e6063f6e326784c0dbde1dc0f02c9217e2cd1e93586921b6023b729/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f726f6c6c796c6e692f72636f6e2d70726f746f636f6c3f7374796c653d706c6173746963)](https://packagist.org/packages/rollylni/rcon-protocol)

RCON Protocol is a TCP / IP, communication-based protocol that allows console commands t mo be issued to a server via a "remote console", or RCON. Most often, RCON is used to allow server owners toanage their game servers without direct access to the machine the server is running on. For commands to be accepted, the connection must first be authenticated using the server's RCON password

[Source RCON Protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)

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

[](#installation)

```
composer require rollylni/rcon-protocol
```

Example Server
--------------

[](#example-server)

```
require "vendor/autoload.php";
use RconProtocol\RconServer;
use RconProtocol\ServerClient;
use RconProtocol\Packet;

$port = 27015;
$host = "0.0.0.0";

$server = new RconServer($port, $host);

# set ur password
$server->setPassword("Your Password");
# or generate
$len = 8;
$server->generatePassword($len);

$server->setMaxClients(10);
# client login timeout
$server->setTimeout(10);

# Events
$handler = $server->getHandler();
$handler->add("onTimeout", function(ServerClient $c) {
   echo $c->getPeerName() . ": timeout!\n";
});

$handler->add("onConnection", function(ServerClient $c) {
   echo $c->getPeerName() . ": connection...\n";
});

$handler->add("onDisconnection", function(ServerClient $c) {
   echo $c->getPeerName() . ": disconnection...\n";
});

$handler->add("onReceive", function(ServerClient $c, Packet $p) {
   echo $c->getPeerName() . ": ". $p->getBody() ."\n";
});

$handler->add("onAuthorized", function(ServerClient $c) {
   echo $c->getPeerName() . ": authorized!\n";
});

$handler->add("onFailed", function(ServerClient $c, string $input) {
   echo $c->getPeerName() . ": '$input' wrong password!\n";
});

$handler->add("onCommand", function(ServerClient $c, string $cmd) {
   //exec command
   echo $c->getPeerName() . ": $cmd\n";
});

// Starting RCON server
$server->start();
// Stopping
$server->stop();
```

Example Client
--------------

[](#example-client)

```
use RconProtocol\RconClient;

$serverHost = "0.0.0.0";
$serverPort = 27015;
$serverPassword = "";
$execCommand = "cmd";
$timeout = 10;

$client = new RconClient($serverHost, $serverPort, $timeout);
$client->connect();
if ($client->authorize($serverPassword)) {
   echo "Response: " . $client->sendCommand($execCommand);
} else {
   $client->disconnect();
}
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1847d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6dc8a4f5a648b18f5a9a761c2b1057d679e72b51ded0eb5ded45b094773ed416?d=identicon)[Rollylni](/maintainers/Rollylni)

---

Top Contributors

[![Rollylni](https://avatars.githubusercontent.com/u/62455812?v=4)](https://github.com/Rollylni "Rollylni (13 commits)")

---

Tags

protocolrconRemote Console

### Embed Badge

![Health badge](/badges/rollylni-rcon-protocol/health.svg)

```
[![Health](https://phpackages.com/badges/rollylni-rcon-protocol/health.svg)](https://phpackages.com/packages/rollylni-rcon-protocol)
```

###  Alternatives

[thedudeguy/rcon

Simple Rcon class for php.

16259.4k1](/packages/thedudeguy-rcon)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
