Request fails to load when accessing req.ip when using docker
export const app = new HyperExpress.Server({
max_body_length: 1 * 1024 * 1024
});
app.get("/", (req, res) => {
console.log(req.ip)
res.send("OK!");
});
app.listen(3000, () => {
console.log(`Server running on 3000`);
});
Deployed as node:22 app in docker and opened http://localhost:3000/ which gives below error in browser. No error in docker logs. Works fine without docker.
Hmmm… can't reach this page The connection was reset. Try:
Checking the connection Checking the proxy and the firewall ERR_CONNECTION_RESET
Issue seems to be with the type of image i'm using. If I change node:22-alpine to node:22-slim I don't see any issue.
I already added RUN apk add --no-cache gcompat as per https://github.com/uNetworking/uWebSockets.js/discussions/158 to support alpine image but it doesn't solve the issue.
Edit: If there is no workaround using alpine image, then maybe add a disclaimer in readme that it doesn't work with alpine images.