Skip to content

Get client process id over ip/port when server runs on UNIX socket. #1418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 3, 2022

Conversation

gh4ck3r
Copy link
Contributor

@gh4ck3r gh4ck3r commented Nov 3, 2022

I put client process id into REMOTE_PORT in http request header when server runs on UNIX socket.
The name might be awkward for process id but, I think, it's acceptable because process id can be used to address client like ip/port. As a matter of fact, process id and ip/port never coexists.

@AhnLab-OSSG

 * set FD_CLOEXEC by default
 * invoke `socket_options` callback if set
HTTP Request header "REMOTE_PORT" contains client process id if possible
when Server works on UNIX socket.
@yhirose
Copy link
Owner

yhirose commented Nov 3, 2022

@gh4ck3r yes, I think it's acceptable to use a process id for port. Thanks again for the fine contribution!

@yhirose yhirose merged commit 93a5197 into yhirose:master Nov 3, 2022
ExclusiveOrange pushed a commit to ExclusiveOrange/cpp-httplib-exor that referenced this pull request May 2, 2023
…hirose#1418)

* handle socket options for UNIX socket same as others

 * set FD_CLOEXEC by default
 * invoke `socket_options` callback if set

* Offer Client info even on UNIX socket based Server

HTTP Request header "REMOTE_PORT" contains client process id if possible
when Server works on UNIX socket.

* retrigger checks

* retrigger checks

* add support macOS

Co-authored-by: Changbin Park <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants