MCPcopy Index your code
hub / github.com/ambianic/peerfetch

github.com/ambianic/peerfetch @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
57 symbols 152 edges 7 files 21 documented · 37%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

peerfetch

Peer-to-peer HTTP over WebRTC. Implements an http client wrapper (similar to HTML fetch) and a corresponding server side HTTP proxy over WebRTC DataChannel. Allows direct secure access from a web browser to edge devices (IoT or servers) hidden behind a firewall.

Highlights: - Excutes in safe application space (no sudo) - End to end encryption - No custom VPN setup needed - No cloud middleman for data tunneling - No dynamic DNS service required - No custom firewall rules required - Programming language agnostic. (Currently available in JavaScript and Python)

Hello World example

See this README for a step by step Hello World example.

How it works

For an in-depth technical discussion and project background, see this blog post.

Hands-on Workshop

Here is the recording of a peerfetch workshop hosted by Python Austin.

Use cases:

  • Direct user access from a web app to private home security camera without sharing footage with a cloud provider.
  • IoT device mesh with direct p2p communication.
  • Personal web apps can share data directly (files, notes, photos) only with the end user without exposing a public IP address.
  • Federated learning - ML models can train on local user data and share learned states directly with each other without a centralized model aggregation server.

Used by

Core symbols most depended-on inside this repo

get
called by 13
javascript/src/peerfetch.ts
request
called by 4
javascript/src/peerfetch.ts
_setPeerConnectionHandlers
called by 2
javascript/src/peerfetch.ts
_sendNextRequest
called by 2
javascript/src/peerfetch.ts
_pendingRequests
called by 2
javascript/src/peerfetch.ts
_checkResponseReady
called by 2
javascript/src/peerfetch.ts
join_peer_room
called by 1
python/src/peerfetch/proxy.py
_savePeerId
called by 1
python/src/peerfetch/proxy.py

Shape

Function 27
Method 22
Class 5
Route 2
Enum 1

Languages

Python54%
TypeScript46%

Modules by API surface

javascript/src/peerfetch.ts26 symbols
python/src/peerfetch/proxy.py24 symbols
examples/helloworld/edge_device/fastapi_app.py7 symbols

For agents

$ claude mcp add peerfetch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact