envoyproxy/envoy

How to listen file descriptor, perhaps using systemd activation protocol

開放

#3,596 建立於 2018年6月12日

 (6 則留言) (1 個反應) (0 位負責人)C++ (5,373 個分叉)batch import
design proposalhelp wanted

倉庫指標

星標
 (27,997 顆星)
PR 合併指標
 (平均合併 8天) (30 天內合併 378 個 PR)

描述

It would be nice to be able to listen standard port 80 and 443 without starting envoy as root user. Systemd provides the standard protocol for that called socket activation protocol. There are also other ways to do the same with e.g. nginx even if it doesn't support that particular protocol.

Is there any equivalent of passing fd to envoy?

If you're not familiar with the concept. It's something like this: supervisor (for example systemd) binds a socket at port say 80. Then it puts the file descriptor into fixed number usually 3 (or starting from three if there are multiple) and removes CLOEXEC flag. So when process starts it has normal stdio file descriptors 0 (stdin), 1 (stdout), 2 (stderr), and also 3 which is a listening socket and can use the latter as a normal socket.

貢獻者指南