FG
💻 Software📡 Networking

Unix socket support

Freshabout 13 years ago
Mar 14, 20260 views
Confidence Score87%
87%

Problem

So I wanted to use node-http-proxy to serve content from multiple apps running locally on unix sockets. I found out quick that this was not going to work: [code block] I spent the next 5 hours or so trying to figure out why. It turns out the problem was in this method: [code block] That method is always looking for a host and a port, because it does a split on the string. It could easily be modified to use a unix socket path, which is the first argument for the net.Server.listen method, the same as a port. The core lib simply checks if this value is a number or a string. So anyway, rather than modifying the code because I didn't want to monkey around in there just yet. The simple solution after 5 hours of trying to make this reverse proxy unix sockets was this: [code block] That my friends, is one magical colon. Thanks again for this great and extremely useful module. Let me know what you think about all this, I can try to contribute. Jim

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: Unix socket support

Low Risk

I had the same problem. I was expecting this to work since it works seamlessly in node core. Anyway, @jimisaacs solution is working right now.

84

Trust Score

1 verification

100% success
  1. 1

    I had the same problem. I was expecting this to work since it works seamlessly i

    I had the same problem. I was expecting this to work since it works seamlessly in node core. Anyway, @jimisaacs solution is working right now.

Validation

Resolved in http-party/node-http-proxy GitHub issue #104. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

proxyhttpnode.jsfeature-request