Skip to content

Instantly share code, notes, and snippets.

@pgvee
Last active October 4, 2017 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgvee/24b159557ed54dff45b691972a487334 to your computer and use it in GitHub Desktop.
Save pgvee/24b159557ed54dff45b691972a487334 to your computer and use it in GitHub Desktop.
This gist is a *VERY* simple server to spoof your location.
#
# In about:config, edit the geo.wifi.uri to be http://localhost:8899
# Restart Firefox
# Profit!
# Pretend you life somewhere in the Magic Kingdom
#
import json
import http.server
import socketserver
PORT = 8899
LAT, LNG = 28.373758, -81.549535
class GeoHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "application/json")
self.end_headers()
self.wfile.write(bytes(json.dumps({
"location": {
"lat": LAT,
"lng": LNG
},
"accuracy": 10
}), "utf-8"))
def do_POST(self):
return self.do_GET()
with http.server.HTTPServer(("", PORT), GeoHandler) as httpd:
print("serving at port", PORT)
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment