TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Bind broker

90 pointsby donmccalmost 8 years ago

7 comments

montecarlalmost 8 years ago
I think this is a response to this: <a href="http:&#x2F;&#x2F;adamierymenko.com&#x2F;privileged-ports-are-causing-climate-change&#x2F;" rel="nofollow">http:&#x2F;&#x2F;adamierymenko.com&#x2F;privileged-ports-are-causing-climat...</a><p>See discussion here: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14712576" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14712576</a>
评论 #14748464 未加载
评论 #14748414 未加载
评论 #14747810 未加载
profwickalmost 8 years ago
Rather than proxying data, why wouldn&#x27;t you just bind the socket, and then transfer the file descriptor over the UNIX domain socket (using sendmsg&#x2F;recvmsg)?<p>Or acept() incoming connections, and <i>then</i> pass the connection&#x27;s file descriptor.
tyingqalmost 8 years ago
User space proxying for protocols other than http, though, is a bit tricky. If you aren&#x27;t exposing things like source ip, listen queue depth, buffer sizes, errno from failures, etc...you are potentially limiting how well it works. Plus the read&#x2F;write overhead. I&#x27;m not convinced this is any better than other approaches. Brokered iptables (or pf,etc) port rewrites seems cleaner, though it has issues as well.
评论 #14745743 未加载
elFartoalmost 8 years ago
It sounds like you should probably just go the whole hog and give each user their own network namespace and bridge them to the main network. Then they can run DHCP and get their own address and do with it what they like.<p>Wouldn&#x27;t really work for Internet accessible IPv4 addresses, but IPv6 would be fine.
nhaehnlealmost 8 years ago
This is neat. There&#x27;s a minor race condition at startup because scanhostdir calls scanportdir before watchdir. Reversing the order of calls would close the gap and shouldn&#x27;t have any adverse effects.
SwellJoealmost 8 years ago
For the most common case of lots of users needing ports (web apps), there&#x27;s the option in nginx and newer Apache versions to proxy to a UNIX socket, so no port is needed for the user app. It&#x27;s not gonna work for everything but <i>many</i> web app servers are fine with using a socket instead of a port.<p>There&#x27;s also <a href="http:&#x2F;&#x2F;cyberelk.net&#x2F;tim&#x2F;software&#x2F;portreserve&#x2F;" rel="nofollow">http:&#x2F;&#x2F;cyberelk.net&#x2F;tim&#x2F;software&#x2F;portreserve&#x2F;</a> for when ports are really needed (not as elegant as the solution under discussion, though, as it just holds a port by binding to it until the rightful owner&#x2F;service comes along).
zokieralmost 8 years ago
I think these days I would approach the problem by creating per-user network namespaces and hack the privileged port limitation away from kernel (is there a sysctl for that&#x2F;why not?)
评论 #14746258 未加载