Skip to content

Raw socket transport communication between PHP and RouterboardOS TCP API

Notifications You must be signed in to change notification settings

alexc-hollywood/php-routerboardos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Routerboard API PHP Bridge

This experimental package provides methods for connecting, authenticating, and fetching interface information directly from a Routerboard device over a TCP socket.

Usage

Basic Connection

use RouterboardOS\Services\API\Bridge;

$bridge = new Bridge ('your_routerboard_host', 8728, 'your_username', 'your_password');

try 
{
	if ($bridge->connect()->login())
	{
		// do stuff
	}
}
catch (Throwable $e)
{
	// socket exception
}

Using Class Components

use RouterboardOS\Services\API\Bridge;
use RouterboardOS\Services\API\Commands\Network\Interfaces;

$bridge = new Bridge ('your_routerboard_host', 8728, 'your_username', 'your_password');

try 
{
	if ($bridge->connect()->login())
	{
		var_dump (
			new Interfaces ($bridge)->data()
		);
	}
}
catch (Throwable $e)
{
	// socket exception
}

About

Raw socket transport communication between PHP and RouterboardOS TCP API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published