Skip to content


Tip of the Week : Running cUrl on localhost can topple your router

I tell a lie. In my last post moments ago I stated: ‘I don’t have any tips right now.’ Forgetting this little beaut.


I had to test some user login data from the old database that I entered into the new database using a simple script. The script mimicked the user registration process, hashing the passwords with a salt before saving etc.

Well, to test each of the 10,000 or so logins I wrote another little script - instead of fussing about replicating the login procedure I thought, why not POST the data directly to the login action on the site, using cUrl - that way I also avoid any problems where my script differs to the live code.

So, cUrl was instructed to POST data to a URL on my localhost and then I just analysed the response. Straight forward stuff. It seems even if cUrl is retrieving a local URL, if it is connected to the network its going to do a round trip to the router and back again? It seems that way because when I ran the script the router would fall over. Even though I have entries in the local hosts file for localhost.

So, someone might like to confirm this for me, but thats my real tip of the day. Careful using cURL even if you are retrieving local content.

Posted in Tips of the Week.

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.