mardi 6 décembre 2016

How to get nearby wifi MAC address and signal strength using HTML5?

As we all know. We can locate ourself using Google Map in Chrome browser.

I want to know how it works. So I open Fiddler to analyze the packets.

I find that Google Map send nearby wifi MAC addresses and signal strength to their server, then return our location.

My question is, what the API Google Map use, to got those wifi information?

POST http://ift.tt/2gzDdIv HTTP/1.1
Host: www.googleapis.com
Connection: keep-alive
Content-Length: 342
Pragma: no-cache
Cache-Control: no-cache
Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36
Accept-Encoding: gzip, deflate, br

{
    "wifiAccessPoints": [
        {
            "age": 0,
            "macAddress": "aa-bb-cc-dd-ee-ff",
            "signalStrength": -54
        },
        {
            "age": 0,
            "macAddress": "11-22-33-44-55-66",
            "signalStrength": -79
        },
        {
            "age": 0,
            "macAddress": "66-55-44-33-22-11",
            "signalStrength": -84
        }
    ]
}

Aucun commentaire:

Enregistrer un commentaire