Git Product home page Git Product logo

detours-clone's Introduction

Detours Clone

This app is an idealogical clone of the Detours app for Mac's created by Jerod Santo - @sant0sk1

This only exists because I wanted to see if I could implement it, and play around with some Python bits I've never had the chance to use.

If you are on a Mac, I'd use the real thing. If you are on Linux, you might give this a shot.

How it works

This app involves a client and a server, since on Linux the hosts file is protected we have to run our daemon with a privileged user. The client and server communicate via TCP sockets with JSON.

Currently there are three clients. One is an HTTP server and one GTK+, and one it Qt.

Both allow you to add/remove/update any items in your hosts file that have been set by this app. You can't edit all the entries, only ones created by Detours.

Security Notice

In case you missed it, the gaping flaw here is that there is now a TCP server that is hooked up to your hosts file, with no authentication mechanism.

This means you should only run this on a single user system, and make sure it is not exposed to the external interface (it binds to 127.0.0.1 but you should verify)

Requirements

Install

Download this package, then, as root, run:

# python setup.py install

That should drop an init script in for you as well as the clients.

Start detoursd like so:

# /etc/init.d/detoursd start

Then a client, like so:

$ detours-gtk

This has been tested on a Debian Sid machine, an Ubuntu machine, and nowhere else. Bug and install reports are coveted!

Always-On Daemon

If you want the daemon to run on boot, you can set up the init script, as root, like so (Ubuntu)

# update-rc.d detoursd defaults

Upgrading

Same process as install, though I recommend stopping your detoursd before the upgrade, then starting it again after.

Tests

There are some basic, non-destructive tests for the module.

From the root directory, run:

$ nosetests

Protocol

The protocol is simple, and is described in PROTOCOL.md

If you want to mess around with it directly, just use telnet (or equivalent)

jmhobbs@Cordelia:~$ telnet localhost 8551
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"method":"list"} 
{"pairs": [{"ip": "127.0.0.1", "host": "kohana"}, {"ip": "127.0.0.1", "host": "launder"}], "response": "list"}Connection closed by foreign host.
jmhobbs@Cordelia:~$ 

detours-clone's People

Contributors

jmhobbs avatar

Stargazers

 avatar  avatar

Watchers

 avatar James Cloos avatar

detours-clone's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.