Ledger Hardware Wallet debug communication layer http proxy (for development only)


455975.0.02 years ago4 years agoMinified + gzip package size for @ledgerhq/hw-http-proxy-devserver in KB



Proxy a Ledger device plugged in USB over HTTP / WebSocket.

  • Plug your Ledger device on your computer
  • Run a HTTP server with the ledger-hw-http-proxy-devserver command
  • Use @ledgerhq/hw-transport-http in your code like a normal transport so you can run Legder device APDU over http.

Goal: This library is meant for DEV & testing purpose only. It is not designed to be used in PROD.


Install with one of these:

npm i -g @ledgerhq/hw-http-proxy-devserver
yarn global add @ledgerhq/hw-http-proxy-devserver

Run the server

In a console, simply run:


hw-transport-http to communicate with the server

To communicate with this server, there is a dedicated Transport library. You can use it like any other Ledger transport like hw-transport-node-hid, hw-transport-u2f, ...

import withStaticURL from "@ledgerhq/hw-transport-http";

// you can change localhost to a local IP (e.g. to use from a Phone)
const Transport = withStaticURL("ws://localhost:8435");

// ... normal @ledgerhq/* code

import AppBtc from "@ledgerhq/hw-app-btc";
const getBtcAddress = async () => {
  const transport = await Transport.create();
  const btc = new AppBtc(transport);
  const result = await btc.getWalletPublicKey("44'/0'/0'/0/0");
  return result.bitcoinAddress;
getBtcAddress().then(a => console.log(a));

More information

Github, Ledger Devs Slack

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.