I am Hack Sparrow
Captain of the Internets.

Node.js get IP Address

Getting a user's IP address seems pretty straightforward in Node.js, right? Does it need a special post on my blog? Yes it does, we'll find out why in a few seconds. Conventional wisdom says, this is how you would get the IP address from a request: [code] var ip = req.connection.remoteAddress; [/code] But there is a problem. If you are running your app behind Nginx or any proxy, every single IP addresses will be 127.0.0.1 :D Probably you can see the problem now. So wha ...

Create animated JPG/JPEG using Node.js

Can JPEGs be animated? Did you see an animated image on the Web and realized with great shock that it was a JPG/JPEG image? You see an animating JPEG right infront of your eyes and start question your knowledge that only the GIF format has the provision for animated images. How is that possible? There are two scenarios to what could be happening. A GIF file got renamed to .jpg, but the browser is smart enough to detect the true soul of the ...