Unix socket support
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
Solution: Unix socket support
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.
Trust Score
1 verification
- 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
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep