luisinder/remote-port-middleware

PSR-7 Middleware that determines the client remote port and stores it as an ServerRequest attribute

1.0.1 2016-09-28 15:39 UTC

This package is auto-updated.

Last update: 2024-04-20 03:33:27 UTC


README

Latest Stable Version Total Downloads

PSR-7 Middleware that determines the client remote port and stores it as an ServerRequest attribute called remotePort.

Installation

composer require luisinder/remote-port-middleware

Usage

In Slim 3:

$app->add(new Luisinder\Middleware\RemotePort());

$app->get('/', function ($request, $response, $args) {
    $remotePort = $request->getAttribute('remotePort');

    return $response;
});