PHPackages                             gemz/port - 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. gemz/port

ActiveLibrary

gemz/port
=========

Domain Port Check

1.0.4(6y ago)0102MITPHPPHP ^7.1.3CI failing

Since Apr 20Pushed 6y agoCompare

[ Source](https://github.com/gemzio/port)[ Packagist](https://packagist.org/packages/gemz/port)[ Docs](https://github.com/gemzio/port)[ Patreon](https://www.patreon.com/gemzio)[ RSS](/packages/gemz-port/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (5)Versions (7)Used By (0)

Domain Port Check
=================

[](#domain-port-check)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d346e1a618edd231ec98d08178b534f8b76ae62d8238ec3bbf757581bee5dceb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656d7a2f706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gemz/port)[![GitHub Tests Action Status](https://camo.githubusercontent.com/30b752e6f37f8bbdc271252863fc4ba11fff95a88ad216876631f51def2beeb8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f67656d7a696f2f706f72742f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/gemzio/port/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Quality Score](https://camo.githubusercontent.com/f4cee6d76464d86ec9849fb4205ec0d4812dc180141ef42e64a547241eb4203f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f67656d7a696f2f706f72742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/gemzio/port)[![Total Downloads](https://camo.githubusercontent.com/749fc0f45f1a4f3be2fa78b4f9f766dee8377eb718debf52c201ddda5f29e00c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67656d7a2f706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gemz/port)

Check ports with protocol. This package uses under the hood [ReactPHP Promises](https://github.com/reactphp/promise).

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

[](#installation)

You can install the package via composer:

```
composer require gemz/port
```

Usage
-----

[](#usage)

```
use \Gemz\Port\Port;

$checks = new Port('gemz.io');
// or
$checks = Port::for('gemz.io');

// check all default ports on tcp
$checks = Port::for('gemz.io')->check();

// check specific ports on tcp
$checks = Port::for('gemz.io')->check(80, 8080, 443, 22, 3306, 9000, 9001);

// check only specific ports on tcp
$checks = Port::for('gemz.io')->useTcp()->check(80, 8080);

// check only specific ports on udp
$checks = Port::for('gemz.io')->useUdp()->check(110, 140);

// check only specific ports on tls
$checks = Port::for('gemz.io')->useTls()->check(443);

// check only specific ports on ssl
$checks = Port::for('gemz.io')->useSsl()->check(443);

// check with array for specific port => protocol checks
// if global setting will be ignored
$checks = Port::for('gemz.io')->useTcp()->check([80 => 'tcp', 2525 => 'udp', 443 => 'tls']);

// check with array for specific port
$checks = Port::for('gemz.io')->useTcp()->check([80, 2525, 443]);

// set timeout, default is 0.5s
$checks = Port::for('gemz.io')->setTimeout(0.4)->check(80);

// get supported protocols
$protocols = Port::for('gemz.io')->getProtocols();

// get default ports
$ports = Port::for('gemz.io')->getDefaultPorts();

// get domain
$protocols = Port::for('gemz.io')->getDomain();
```

### Testing

[](#testing)

```
composer test
composer test-coverage
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Stefan Riehl](https://github.com/stefanriehl)
- [All Contributors](../../contributors)

Support us
----------

[](#support-us)

Gemz.io is maintained by [Stefan Riehl](https://github.com/stefanriehl). You'll find all open source projects on [Gemz.io github](https://github.com/gemzio).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Every ~0 days

Total

6

Last Release

2218d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4265046f24e014f773ad4f7cb289fb27b313d75f2810085462b7bd590d963ebe?d=identicon)[stefanriehl](/maintainers/stefanriehl)

---

Tags

reactphpportgemz

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gemz-port/health.svg)

```
[![Health](https://phpackages.com/badges/gemz-port/health.svg)](https://phpackages.com/packages/gemz-port)
```

###  Alternatives

[react/react

ReactPHP: Event-driven, non-blocking I/O with PHP.

9.1k3.6M63](/packages/react-react)[react/socket

Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP

1.3k116.9M402](/packages/react-socket)[react/dns

Async DNS resolver for ReactPHP

535114.1M100](/packages/react-dns)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[react/promise-timer

A trivial implementation of timeouts for Promises, built on top of ReactPHP.

34141.9M96](/packages/react-promise-timer)

PHPackages © 2026

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