hyper-express icon indicating copy to clipboard operation
hyper-express copied to clipboard

Request fails to load when accessing req.ip when using docker

Open AndeYashwanth opened this issue 10 months ago • 1 comments

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

AndeYashwanth avatar Jun 30 '25 19:06 AndeYashwanth

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.

AndeYashwanth avatar Jul 01 '25 18:07 AndeYashwanth