Allow getRemoteAddress to return the PID of a connecting Unix connection

Offen
#150 9 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
php
Bereich
networking

Rechercherichtung

Start by locating the getRemoteAddress entry point used by UnixServer connections and inspect how Unix and non-Unix addresses are currently handled. Verify the available socket peer-credential behavior and existing coverage, then ensure a connecting Unix client exposes its PID while other address handling remains unchanged.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

help wanted new feature

Currently when dealing with a UnixServer, its connections do not return a value for getRemoteAddress, the returned value is actually NULL.
I`d like it to return the PID of the connecting client. Is that something you would integrate in this library?

public function getRemoteAddress()
{
    if($this->unix){
        $socket = socket_import_stream($this->stream);

        return socket_get_option($socket, SOL_SOCKET, 17 /*SO_PEERCRED*/);
    }
    return $this->parseAddress(@stream_socket_get_name($this->stream, true));
}

See http://php.net/manual/en/function.socket-get-option.php#101380

Vorherrschende Sprache
PHP
Sterne
1.3k
Forks
160
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus reactphp/socket

Alle Issues in reactphp/socket

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.