Closed sixcolors closed 8 months ago
Further info Vite dev server only responds at http://localhost:5173
not http://127.0.0.1:5173
using curl, Safari or Chrome. Consistent with net/http client.
This is because vite
only listens on IPv6 and fasthttp doesn't try dialing IPv6 by default. If you change the code to this it works:
client := fasthttp.Client{
DialDualStack: true,
}
statusCode, body, err := client.Get(nil, "http://localhost:5173")
Bug Description
When using fasthttp.Client to connect to a Vite/react dev server running on port
http://localhost: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
Don't run the main.go from the project but instead run the following:
Expected Behavior
net/http client and fasthttp client both work the same.
Actual result
related to bug report in downstream https://github.com/gofiber/fiber/issues/2890