Monday 29 April 2019

How to use non-loopback IP address in development for express/koa?

When developing in express or koa and I want to get the IP address (ctx.ip in koa) it gives me 127.0.0.1 because I'm accessing the site locally on localhost. Is there any way I can set up node or express/koa to not use loopback and use my "real" IP when accessing a certain site or port? I've got it running on http://somednsalias.development:3000 where the alias comes from a local dnsmasq server.

Submitted April 29, 2019 at 09:07PM by nowboarding

No comments:

Post a Comment