DEV Community

Merlier
Merlier

Posted on

How to test easily your local website on real phone devices

Imagine you're developing a cool responsive website to use with mobile. You have develop some special features like using geolocation or cam qrcode scanner to work well with mobile experience. But how to test those features in local where you just have easily access to your website through your computer.

To achieve this, You can use httpdumper.

Requirements:

  • node >= 11.0
  • wifi network where your computer with your local website and your mobile are connected together.

Install

$ npm i -g httpdumper
Enter fullscreen mode Exit fullscreen mode

Getting started

  1. Get your local computer IP

on linux with:

$ /sbin/ifconfig
Enter fullscreen mode Exit fullscreen mode

you should get your local IP for your wifi interface, so something like this by example:

192.168.X.X
Enter fullscreen mode Exit fullscreen mode
  1. Run httpdumper

If you have your local website running on http://localhost:9000 from your computer. You can just start httpdumper like this:

$ httpdumper --port="3000" --host="http://localhost:9000" --uplaodDir="./uploads/"
Enter fullscreen mode Exit fullscreen mode
  1. Mobile test

Access your local website from your mobile browser at the address:

http://<your-local-ip>:3000
Enter fullscreen mode Exit fullscreen mode

You will get the log requests in the terminal. If your requests have some files, they will be uploaded in the specified upload directory.

Hope it will be useful for some of you!
:)

Top comments (1)

Collapse
 
kamkara profile image
kamate vakaramoko

Hi, you're magic, thank for a tip