Giter Site home page Giter Site logo

bdraco / hap-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from supereg/hap-proxy

0.0 0.0 0.0 773 KB

Transparent Proxy for the HomeKit Accessory Protocol to intercept and analyze traffic between an Accessory and an iDevice.

License: MIT License

JavaScript 0.10% TypeScript 99.90%

hap-proxy's Introduction

hap-proxy

hap-proxy is a transparent proxy for the HomeKit Accessory Protocol (HAP). On the one hand it acts as an HomeKit accessory and exposes and HAP server (to which you would connect to) and on the other hand it acts as an HomeKit controller to an existing HomeKit accessory. hap-proxy is compliant with hap v1.1.0 meaning it is also capable of proxying HomeKit Data Streams (v1.0) used for HomeKit Remotes and Secure Video.

hap-proxy is currently work in progress and definitely not finished. Currently, the ambition of the project is to have a hap proxy which can be used for research and reverse engineering. The goal is that hap-proxy outputs the communication made between the HomeKit controller (iOS device etc.) and the proxied accessory in a format like pcap.

If there is interest I could imagine adding functionality which could be helpful to more people. For example features like integrating one HomeKit accessory into multiple HomeKit homes or adding some kind of plugin based filtering, which could be used to alter behaviour of certified HomeKit accessories or adding custom capabilities programmatically to certified HomeKit accessories. Hit me up if you are interested or have any additional ideas.

Installation

sudo npm install -g hap-proxy

Command Line

When installing hap-proxy globally the command-line program hap-proxy will be added to your system.
Running hap-proxy -h will display the following help menu:

Usage: hap-proxy [options]

Options:
  -V, --version                      output the version number
  -p, --port <port>                  define the proxy port (default: 60141)
  -t, --target-name <instance name>  define the instance name of the device which should be proxied
  -c, --target-pincode <pincode>     define the pincode with dashes of the homekit device to be proxied
  --proxy-pincode <pincode>          define a separate pincode for the proxy server
  --hostname <hostname>              define an overwrite for the hostname of the target device. By default the hostname is learned from mDNS service discovery
  -h, --help                         display help for command

When you want to proxy an existing homekit device you must first ensure that the device is unpaired and added to you Wi-Fi.

In order to start up a basic proxy you must supply --target-name and --target-pincode.
The first name give the Instance Name of the accessory. The easiest way to get that is to open the Home App, open the pairing menu and copy the name of the desired accessory.

The target pincode is the pincode of the HomeKit accessory. If --proxy-pincode is not defined the proxy server will use the same pincode.

API

Once I reached a point where the API can be considered stable I'm going to update this section.

Notes

This project is heavily inspired by the code base of HAP-NodeJS (most of the encryption and decryption layers) and hap-client.

hap-proxy's People

Contributors

dependabot[bot] avatar supereg avatar

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.