https://github.com/kizzycode/remote_pid
A Rust crate to get the PID of the remote endpoint of a TCP connection on localhost
https://github.com/kizzycode/remote_pid
Last synced: about 2 months ago
JSON representation
A Rust crate to get the PID of the remote endpoint of a TCP connection on localhost
- Host: GitHub
- URL: https://github.com/kizzycode/remote_pid
- Owner: KizzyCode
- Created: 2019-03-30T18:41:03.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-05T19:49:25.000Z (about 6 years ago)
- Last Synced: 2025-02-06T04:44:16.764Z (3 months ago)
- Language: Rust
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://opensource.org/licenses/BSD-2-Clause)
[](https://opensource.org/licenses/MIT)# remote_pid
This crate allows you to get the PID of the remote endpoint of a TCP connection if the remote
endpoint is running on the same host.## FAQ:
- What is the purpose of this crate? This crate can be used in IPC contexts to get the PID of the
remote caller and authenticate it subsequently.
- Why TCP? TCP on localhost is the only connection-based IPC mechanism that works on nearly every
desktop OS and the only IPC mechanism that can be used to authenticate the other endpoint on
nearly every desktop OS.## Caveats:
- Currently Unix only
- Usually needs root permissions to identify endpoints owned by a different user
- Relies on an external program (`lsof` under Unix)# C-API
To build and install the library with an `extern "C"`-interface, go into `c_api` and run
`make install`. The files are placed into `$PREFIX/lib` and `$PREFIX/include` where `$PREFIX`
defaults to `/usr/local`.