-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 [Bug]: Proxy middleware and Vite dev server on localhost, tcp4 127.0.0.1:5173: connect: connection refused #2890
Comments
bug filed with upstream package valyala/fasthttp#1730 |
Erik Dubbelboer from upstream issue:
|
Further ref for Vite/node: vitejs/vite#2032 https://nodejs.org/api/net.html#net_server_listen_options_callback |
Should we support dual stack be default in the client for proxy middleware? |
I believe adding an option for DialDualStack won't hurt. As a fiber user, I'm forced to fork proxy middleware to enable it as my cloud provider only support IPv6 for internal networking. I can contribute if needed. |
@negrel Agree we should add an option to allow either ipv4, ipv6 or DialDual to the middleware. Sounds reasonable to me. |
Bug Description
When using the proxy middleware to
proxy.BalanceForward([]string{"http://localhost:5173"}))
to a Vite/react dev server running on port 5173 the connection is refused with the following outputError: The HTTP request failed with error dial tcp4 127.0.0.1:5173: connect: connection refused
How to Reproduce
Clone https://github.com/sixcolors/FiberReactTest
The proxy demonstrates this behaviour as can be seen in the main.go:
However the issue has been isolated to the fasthttp client.
To verify run the following:
Expected Behavior
fasthttp client should connect to http://localhost:5173 and the proxy should work.
Actual Behavior
fasthttp client will not try dialing IPv6 by default and only IPv4 is tried, resulting in a connection refused error.
Fiber Version
v2.52.2
Code Snippet (optional)
No response
Checklist:
The text was updated successfully, but these errors were encountered: